cmake introduction
A short example project for the CMake build system
core.cxx
Go to the documentation of this file.
1 #include "config.h"
2 #include <iostream>
3 #include "core.h"
4 #include "lapack_wrapper.h"
5 
6 namespace core
7 {
8 /* implementation of solve_linear_system declared in core.h */
10 {
11  std::cout << "Solving linear system" << std::endl;
12  int info;
13 
14  int* ipiv = new int[matrix.get_size()];
15 
16  int size = matrix.get_size();
17  int one = 1;
18 
19  dgesv_wrap(&size,
20  &one,
21  matrix.get_values(),
22  &size,
23  ipiv,
24  rhs.get_values(),
25  &size,
26  &info);
27 
28  delete[] ipiv;
29  return info;
30 }
31 
32 }
int get_size() const
get the number of rows/columns
Definition: matrix.h:52
Namespace for core components.
Definition: core.h:11
Scalar * get_values()
get the array of elements of the vector
Definition: vector.h:55
Scalar * get_values()
get the array of elements of the matrix
Definition: matrix.h:58
int solve_linear_system(Matrix< double > &A, Vector< double > &rhs)
Definition: core.cxx:9
void dgesv_wrap(int *N, int *NRHS, double *A, int *LDA, int *IPIV, double *B, int *LDB, int *INFO)
Wrapper function around around dgesv_.
A dense quadratic matrix of arbitrary size.
Definition: matrix.h:19
A vector of arbitrary size.
Definition: vector.h:18