ALP User Documentation  0.8.preview
Algebraic Programming User Documentation
blas_sparse_vec.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright 2021 Huawei Technologies Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
34 #ifndef _H_ALP_SPARSEBLAS_EXT_VEC
35 #define _H_ALP_SPARSEBLAS_EXT_VEC
36 
44 #define __SPBLAS_CONC( _a, _b ) _a ## _b
45 #define __SPBLAS_CONCAT( _a, _b ) __SPBLAS_CONC( _a, _b )
46 #define SPCONCAT( _a, _b ) __SPBLAS_CONCAT( _a, _b )
47 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
64 #define EXTBLAS_FUN( name ) SPCONCAT( EXTBLAS_, name )
65 #define EXTBLAS_TYPE( name ) SPCONCAT( extblas_, name )
66 
69 typedef void * EXTBLAS_TYPE( sparse_vector );
70 
80 EXTBLAS_TYPE( sparse_vector ) EXTBLAS_FUN( dusv_begin )( const int n );
81 
98 int EXTBLAS_FUN( dusv_insert_entry )(
99  EXTBLAS_TYPE( sparse_vector ) x,
100  const double val,
101  const int index
102 );
103 
116 int EXTBLAS_FUN( dusv_end )( EXTBLAS_TYPE( sparse_vector ) x );
117 
130 int EXTBLAS_FUN( dusvds )( EXTBLAS_TYPE( sparse_vector ) x );
131 
145 int EXTBLAS_FUN( dusv_nz )( const EXTBLAS_TYPE( sparse_vector ) x, int * nz );
146 
162 int EXTBLAS_FUN( dusv_open )( const EXTBLAS_TYPE( sparse_vector ) x );
163 
192 int EXTBLAS_FUN( dusv_get )(
193  const EXTBLAS_TYPE( sparse_vector ) x,
194  double * const val, int * const ind
195 );
196 
208 int EXTBLAS_FUN( dusv_close )( const EXTBLAS_TYPE( sparse_vector ) x );
209 
221 int EXTBLAS_FUN( dusv_clear )( EXTBLAS_TYPE( sparse_vector ) x );
222  // end doxygen grouping for SPARSEBLAS
224 
225 #ifdef __cplusplus
226 } // end extern "C"
227 #endif
228 
229 #endif // end `_H_ALP_SPARSEBLAS_EXT_VEC'
230