VMTK
Loading...
Searching...
No Matches
vtkvmtkSparseMatrix.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: VMTK
4
5 Copyright (c) Luca Antiga, David Steinman. All rights reserved.
6 See LICENSE file for details.
7
8 Portions of this code are covered under the VTK copyright.
9 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
10 for details.
11
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
15
16=========================================================================*/
37
38#ifndef __vtkvmtkSparseMatrix_h
39#define __vtkvmtkSparseMatrix_h
40
41#include "vtkObject.h"
44#include "vtkvmtkStencils.h"
45#include "vtkvmtkDoubleVector.h"
46#include "vtkDataSet.h"
47#include "vtkvmtkWin32Header.h"
48
49class VTK_VMTK_DIFFERENTIAL_GEOMETRY_EXPORT vtkvmtkSparseMatrix : public vtkObject
50{
51public:
52
54 vtkTypeMacro(vtkvmtkSparseMatrix,vtkObject);
55
62
68
72 vtkvmtkSparseMatrixRow* GetRow(vtkIdType i) { return this->Array[i]; }
73
77 vtkGetMacro(NumberOfRows,vtkIdType);
78
85
93 void AllocateRowsFromNeighborhoods(vtkvmtkNeighborhoods *neighborhoods, int numberOfVariables=1);
94
100 void AllocateRowsFromDataSet(vtkDataSet *dataSet, int numberOfVariables=1);
101
105 void Initialize();
106
113 void SetNumberOfRows(vtkIdType numberOfRows);
114
120 double GetElement(vtkIdType i, vtkIdType j);
121
127 void SetElement(vtkIdType i, vtkIdType j, double value);
128
133 void AddElement(vtkIdType i, vtkIdType j, double value);
134
138 void DeepCopy(vtkvmtkSparseMatrix *src);
139
140protected:
143
145 vtkIdType NumberOfRows;
146
147private:
148 vtkvmtkSparseMatrix(const vtkvmtkSparseMatrix&); // Not implemented.
149 void operator=(const vtkvmtkSparseMatrix&); // Not implemented.
150};
151
152#endif
153
Serves as the base class for vectors utilized in finite-element and other PDE evaluations.
Create an empty, polydata, polydata manifold, polydata manifold extended, or unstructured grid neighb...
Represents a single row of a vtkvmtkSparseMatrix: a sparse list of (column id, value) pairs plus a se...
void SetNumberOfRows(vtkIdType numberOfRows)
static vtkvmtkSparseMatrix * New()
vtkvmtkSparseMatrixRow * GetRow(vtkIdType i)
void CopyRowsFromStencils(vtkvmtkStencils *stencils)
double GetElement(vtkIdType i, vtkIdType j)
void AllocateRowsFromNeighborhoods(vtkvmtkNeighborhoods *neighborhoods, int numberOfVariables=1)
void Multiply(vtkvmtkDoubleVector *x, vtkvmtkDoubleVector *y)
void AddElement(vtkIdType i, vtkIdType j, double value)
void TransposeMultiply(vtkvmtkDoubleVector *x, vtkvmtkDoubleVector *y)
vtkvmtkSparseMatrixRow ** Array
void DeepCopy(vtkvmtkSparseMatrix *src)
void SetElement(vtkIdType i, vtkIdType j, double value)
void AllocateRowsFromDataSet(vtkDataSet *dataSet, int numberOfVariables=1)
Create an empty, umbrella, area weighted umbrella, finite-element LP, or finite-volume finite-element...