ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
spblas.hpp
Go to the documentation of this file.
1/*
2 * $Id$
3 * Copyright (C) 2010, 2018, 2019, 2020 John D Lamb
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20#ifndef CCGSL_SPBLAS
21#define CCGSL_SPBLAS
22
23#include<cmath>
24#include<gsl/gsl_spblas.h>
25#include"vector.hpp"
26#include"spmatrix.hpp"
27#include"blas.hpp"
28
29namespace gsl {
33 namespace spblas {
44 inline int dgemv( CBLAS_TRANSPOSE_t const TransA, double const alpha, spmatrix const& A,
45 vector const& x, double const beta, vector& y ){
46 return gsl_spblas_dgemv( TransA, alpha, A.get(), x.get(), beta, y.get() ); }
55 inline int dgemm( double const alpha, spmatrix const& A, spmatrix const& B, spmatrix& C ){
56 return gsl_spblas_dgemm( alpha, A.get(), B.get(), C.get() ); }
57#ifndef DOXYGEN_SKIP
70 inline size_t scatter( spmatrix const& A, size_t const j, double const alpha, int* w,
71 double* x, int const mark, spmatrix& C, size_t nz ){
72 return gsl_spblas_scatter( A.get(), j, alpha, w, x, mark, C.get(), nz ); }
73#endif // DOXYGEN_SKIP
74 }
75}
76
77#endif
This class handles sparse matrix objects as shared handles.
Definition: spmatrix.hpp:38
double get(size_t const i, size_t const j) const
C++ version of gsl_spmatrix_get().
Definition: spmatrix.hpp:402
This class handles vector objects as shared handles.
Definition: vector.hpp:74
gsl_vector * get()
Get the gsl_vector.
Definition: vector.hpp:1320
double beta(rng const &r, double const a, double const b)
C++ version of gsl_ran_beta().
Definition: randist.hpp:262
int dgemv(CBLAS_TRANSPOSE_t const TransA, double const alpha, spmatrix const &A, vector const &x, double const beta, vector &y)
C++ version of gsl_spblas_dgemv().
Definition: spblas.hpp:44
int dgemm(double const alpha, spmatrix const &A, spmatrix const &B, spmatrix &C)
C++ version of gsl_spblas_dgemm().
Definition: spblas.hpp:55
The gsl package creates an interface to the GNU Scientific Library for C++.
Definition: blas.hpp:34