PeriDyno 1.0.0
Loading...
Searching...
No Matches
SparseMatrix.h
Go to the documentation of this file.
1
16#pragma once
17#include "Array/Array.h"
18#include "Array/ArrayMap.h"
19
20
21
22namespace dyno
23{
24 template <typename VarType>
26 {
27 public:
30
32
37
41 void clear();
42
43 void assign_cgls(CArray<VarType>& s_b, std::vector<std::map<int, VarType>>& s_matrix, std::vector<std::map<int, VarType>>& s_matrix_transposed);
44
45 void CGLS(int i_max, VarType threshold);
46
47 const SparseV& X() const { return my_x; }
48
49 private:
52
55 };
56}
57
58#include "SparseMatrix.inl"
void assign_cgls(CArray< VarType > &s_b, std::vector< std::map< int, VarType > > &s_matrix, std::vector< std::map< int, VarType > > &s_matrix_transposed)
void clear()
Free allocated memory. Should be called before the object is deleted.
void CGLS(int i_max, VarType threshold)
DArrayMap< VarType > SparseM
const SparseV & X() const
DArray< VarType > SparseV
~SparseMatrix()
Do not release memory here, call clear() explicitly.
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89
ArrayMap< T, DeviceType::GPU > DArrayMap
Definition ArrayMap.inl:82
Array< T, DeviceType::CPU > CArray
Definition Array.h:151