VTK
vtkDiagonalMatrixSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDiagonalMatrixSource.h
5 
6 -------------------------------------------------------------------------
7  Copyright 2008 Sandia Corporation.
8  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9  the U.S. Government retains certain rights in this software.
10 -------------------------------------------------------------------------
11 
12  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13  All rights reserved.
14  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
15 
16  This software is distributed WITHOUT ANY WARRANTY; without even
17  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18  PURPOSE. See the above copyright notice for more information.
19 
20 =========================================================================*/
21 
31 #ifndef vtkDiagonalMatrixSource_h
32 #define vtkDiagonalMatrixSource_h
33 
34 #include "vtkFiltersSourcesModule.h" // For export macro
35 #include "vtkArrayDataAlgorithm.h"
36 
37 class VTKFILTERSSOURCES_EXPORT vtkDiagonalMatrixSource : public vtkArrayDataAlgorithm
38 {
39 public:
40  static vtkDiagonalMatrixSource* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44  // Determines whether the output matrix will be dense or sparse
46  {
48  SPARSE
49  };
50 
51  vtkGetMacro(ArrayType, int);
52  vtkSetMacro(ArrayType, int);
53 
55 
58  vtkGetMacro(Extents, vtkIdType);
59  vtkSetMacro(Extents, vtkIdType);
61 
63 
66  vtkGetMacro(Diagonal, double);
67  vtkSetMacro(Diagonal, double);
69 
71 
74  vtkGetMacro(SuperDiagonal, double);
75  vtkSetMacro(SuperDiagonal, double);
77 
79 
82  vtkGetMacro(SubDiagonal, double);
83  vtkSetMacro(SubDiagonal, double);
85 
87 
91  vtkGetStringMacro(RowLabel);
92  vtkSetStringMacro(RowLabel);
94 
96 
100  vtkGetStringMacro(ColumnLabel);
101  vtkSetStringMacro(ColumnLabel);
103 
104 protected:
106  ~vtkDiagonalMatrixSource() override;
107 
108  int RequestData(
111  vtkInformationVector*) override;
112 
113 private:
115  void operator=(const vtkDiagonalMatrixSource&) = delete;
116 
117  vtkArray* GenerateDenseArray();
118  vtkArray* GenerateSparseArray();
119 
120  int ArrayType;
121  vtkIdType Extents;
122  double Diagonal;
123  double SuperDiagonal;
124  double SubDiagonal;
125  char* RowLabel;
126  char* ColumnLabel;
127 };
128 
129 #endif
130 
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Store vtkAlgorithm input/output information.
Abstract interface for N-dimensional arrays.
Definition: vtkArray.h:64
int vtkIdType
Definition: vtkType.h:347
a simple class to control print indentation
Definition: vtkIndent.h:33
Superclass for algorithms that produce vtkArrayDatas as output.
generates a sparse or dense square matrix with user-specified values for the diagonal,...
static vtkArrayDataAlgorithm * New()
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.