Fork me on GitHub
 All Classes Files Functions Variables Groups Pages
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 
25 namespace cusp
26 {
27 
42 template <typename MatrixType>
43 bool is_valid_matrix(const MatrixType& matrix);
44 
55 template <typename MatrixType, typename OutputStream>
56 bool is_valid_matrix(const MatrixType& matrix, OutputStream& ostream);
57 
65 template <typename MatrixType>
66 void assert_is_valid_matrix(const MatrixType& matrix);
67 
78 template <typename Array1, typename Array2>
79 void assert_same_dimensions(const Array1& array1,
80  const Array2& array2);
81 
94 template <typename Array1, typename Array2, typename Array3>
95 void assert_same_dimensions(const Array1& array1,
96  const Array2& array2,
97  const Array3& array3);
98 
113 template <typename Array1, typename Array2, typename Array3, typename Array4>
114 void assert_same_dimensions(const Array1& array1,
115  const Array2& array2,
116  const Array3& array3,
117  const Array4& array4);
118 
122 } // end namespace cusp
123 
124 #include <cusp/detail/verify.inl>
void assert_is_valid_matrix(const MatrixType &matrix)
Validate format of a given matrix and exit if invalid.
bool is_valid_matrix(const MatrixType &matrix, OutputStream &ostream)
Validate format of a given matrix.
void assert_same_dimensions(const Array1 &array1, const Array2 &array2, const Array3 &array3, const Array4 &array4)
Assert dimensions of two arrays are equal. Throw invalid input exception if dimensions do not match...