CUSP
Loading...
Searching...
No Matches
verify.h
Go to the documentation of this file.
1/*
2 * Copyright 2008-2014 NVIDIA Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
21#pragma once
22
23#include <cusp/detail/config.h>
24
25namespace cusp
26{
27
42template <typename MatrixType>
43bool is_valid_matrix(const MatrixType& matrix);
44
55template <typename MatrixType,
56 typename OutputStream>
57bool is_valid_matrix(const MatrixType& matrix,
58 OutputStream& ostream);
59
67template <typename MatrixType>
68void assert_is_valid_matrix(const MatrixType& matrix);
69
80template <typename Array1,
81 typename Array2>
82void assert_same_dimensions(const Array1& array1,
83 const Array2& array2);
84
97template <typename Array1,
98 typename Array2,
99 typename Array3>
100void assert_same_dimensions(const Array1& array1,
101 const Array2& array2,
102 const Array3& array3);
103
118template <typename Array1,
119 typename Array2,
120 typename Array3,
121 typename Array4>
122void assert_same_dimensions(const Array1& array1,
123 const Array2& array2,
124 const Array3& array3,
125 const Array4& array4);
126
130} // end namespace cusp
131
132#include <cusp/detail/verify.inl>
void assert_is_valid_matrix(const MatrixType &matrix)
Validate format of a given matrix and exit if invalid.
void assert_same_dimensions(const Array1 &array1, const Array2 &array2)
Assert dimensions of two arrays are equal. Throw invalid input exception if dimensions do not match.
bool is_valid_matrix(const MatrixType &matrix)
Validate format of a given matrix.