#include <IccSparseMatrix.h>
|
| CIccSparseMatrix (const CIccSparseMatrix &mtx) |
|
| CIccSparseMatrix (void *pMatrix=NULL, icUInt32Number nSize=0, icSparseMatrixType nType=icSparseMatrixFloatNum, bool bInitFromData=false) |
|
virtual | ~CIccSparseMatrix (void) |
|
void | Clear () |
|
icUInt16Number | Cols () const |
|
bool | Copy (const CIccSparseMatrix &mtx) |
|
bool | FillFromFullMatrix (icFloatNumber *pData) |
|
icUInt16Number * | GetColumnsForRow (icUInt16Number nRow=0) const |
|
IIccSparseMatrixEntry * | GetData () const |
|
icUInt32Number | GetMaxEntries () |
|
icUInt16Number | GetNumEntries () const |
|
icUInt16Number | GetNumRowColumns (icUInt16Number nRow) const |
|
icUInt16Number | GetRowOffset (icUInt16Number nRow=0) |
|
icUInt16Number * | GetRowStart () const |
|
bool | Init (icUInt16Number nRows, icUInt16Number nCols, bool bSetData=false) |
|
bool | Interp (icFloatNumber d1, const CIccSparseMatrix &mtx1, icFloatNumber d2, const CIccSparseMatrix &mtx2) |
|
bool | IsValid () |
|
bool | MultiplyVector (icFloatNumber *pResult, const icFloatNumber *pVector) const |
|
CIccSparseMatrix & | operator= (const CIccSparseMatrix &mtx) |
|
void | Reset (void *pMatrix, icUInt32Number nSize, icSparseMatrixType nType, bool bInitFromData=true) |
|
icUInt16Number | Rows () const |
|
bool | Union (const CIccSparseMatrix &mtx1, const CIccSparseMatrix &mtx2) |
|
◆ CIccSparseMatrix() [1/2]
6{
11
12 if (bInitFromData) {
16 }
17 else {
23 }
24}
unsigned short icUInt16Number
Definition icProfileHeader.h:256
icUInt16Number * m_ColumnIndices
Definition IccSparseMatrix.h:203
IIccSparseMatrixEntry * m_Data
Definition IccSparseMatrix.h:205
icUInt8Number * m_pMatrix
Definition IccSparseMatrix.h:195
icUInt16Number m_nCols
Definition IccSparseMatrix.h:200
icSparseMatrixType m_nType
Definition IccSparseMatrix.h:197
icUInt32Number m_nRawSize
Definition IccSparseMatrix.h:196
icUInt32Number m_nMaxEntries
Definition IccSparseMatrix.h:207
icUInt16Number m_nRows
Definition IccSparseMatrix.h:199
icUInt16Number * m_RowStart
Definition IccSparseMatrix.h:202
bool Init(icUInt16Number nRows, icUInt16Number nCols, bool bSetData=false)
Definition IccSparseMatrix.cpp:138
References Init(), m_ColumnIndices, m_Data, m_nCols, m_nMaxEntries, m_nRawSize, m_nRows, m_nType, m_pMatrix, and m_RowStart.
Referenced by CIccTagSparseMatrixArray::Describe(), CIccTagSparseMatrixArray::Interpolate(), and CIccTagSparseMatrixArray::Validate().
◆ CIccSparseMatrix() [2/2]
27{
31
36 break;
39 break;
42 break;
45 break;
48 default:
50 }
51 }
52
55 }
56 else {
62 }
63}
@ icSparseMatrixUInt16
Definition icProfileHeader.h:1346
@ icSparseMatrixFloat32
Definition icProfileHeader.h:1348
@ icSparseMatrixFloat16
Definition icProfileHeader.h:1347
@ icSparseMatrixUInt8
Definition icProfileHeader.h:1345
#define icSparseMatrixFloatNum
Definition icProfileHeader.h:1359
Definition IccSparseMatrix.h:107
Definition IccSparseMatrix.h:117
Definition IccSparseMatrix.h:127
Definition IccSparseMatrix.h:136
Definition IccSparseMatrix.h:145
References CIccSparseMatrixFloat16::CIccSparseMatrixFloat16(), CIccSparseMatrixFloat32::CIccSparseMatrixFloat32(), CIccSparseMatrixFloatNum::CIccSparseMatrixFloatNum(), CIccSparseMatrixUInt16::CIccSparseMatrixUInt16(), CIccSparseMatrixUInt8::CIccSparseMatrixUInt8(), icSparseMatrixFloat16, icSparseMatrixFloat32, icSparseMatrixUInt16, icSparseMatrixUInt8, Init(), m_ColumnIndices, m_Data, m_nCols, m_nMaxEntries, m_nRawSize, m_nRows, m_nType, m_pMatrix, and m_RowStart.
◆ ~CIccSparseMatrix()
CIccSparseMatrix::~CIccSparseMatrix |
( |
void |
| ) |
|
|
virtual |
◆ Clear()
void CIccSparseMatrix::Clear |
( |
| ) |
|
◆ Cols()
◆ Copy()
◆ EntrySize()
◆ FillFromFullMatrix()
bool CIccSparseMatrix::FillFromFullMatrix |
( |
icFloatNumber * |
pData | ) |
|
◆ GetColumnsForRow()
◆ GetData()
◆ GetMaxEntries()
◆ GetNumEntries()
◆ GetNumRowColumns()
◆ GetRowOffset()
◆ GetRowStart()
◆ Init()
139{
141 return false;
142
144
147
151 break;
154 break;
157 break;
160 break;
163 break;
164 default:
167 if (bSetData) {
168 Dim[0] = 0;
169 Dim[1] = 0;
170 }
175 return false;
176 }
179 if (bSetData) {
180 Dim[0] = nRows;
181 Dim[1] = nCols;
182 }
183
186
190 if (bSetData) {
191 Dim[0] = 0;
192 Dim[1] = 0;
193 }
198 return false;
199 }
200
202
204
207
209
210 return true;
211}
virtual void init(void *pData)=0
virtual icUInt8Number size() const =0
References CIccSparseMatrixFloat16::CIccSparseMatrixFloat16(), CIccSparseMatrixFloat32::CIccSparseMatrixFloat32(), CIccSparseMatrixFloatNum::CIccSparseMatrixFloatNum(), CIccSparseMatrixUInt16::CIccSparseMatrixUInt16(), CIccSparseMatrixUInt8::CIccSparseMatrixUInt8(), icSparseMatrixFloat16, icSparseMatrixFloat32, icSparseMatrixUInt16, icSparseMatrixUInt8, IIccSparseMatrixEntry::init(), m_ColumnIndices, m_Data, m_nCols, m_nMaxEntries, m_nRawSize, m_nRows, m_nType, m_pMatrix, m_RowStart, and IIccSparseMatrixEntry::size().
Referenced by CIccSparseMatrix(), CIccSparseMatrix(), Copy(), Interp(), operator=(), CIccTagXmlSparseMatrixArray::ParseXml(), Reset(), Union(), and CIccTagSparseMatrixArray::Validate().
◆ Interp()
289{
291 return false;
292
295 return false;
296 }
297
299 int r=0, i, j;
300 int fA, fB, nA, nB, offA, offB, iA, iB;
301
302 for (r=0; r<(int)
m_nRows; r++) {
307
309
310 if (nA && nB) {
311 i=j=0;
312
313 while(i<nA || j<nB) {
315 return false;
316
317 if (i<nA && j<nB) {
318 offA = fA+i;
319 offB = fB+j;
322
323 if (iA<iB) {
326 i++;
327 }
328 else if (iB<iA) {
331 j++;
332 }
333 else {
336 i++;
337 j++;
338 }
339 pos++;
340 }
341 else if (i<nA) {
342 offA = fA+i;
344
347 }
348 else {
349 offB = fB+j;
351
354 }
355 }
356 }
357 else if (nA) {
359 return false;
360
362
363 for (i=0; i<nA; i++) {
365 }
366 }
367 else if (nB) {
369 return false;
370
372
373 for (i=0; i<nB; i++) {
375 }
376 }
378 }
379
380 return true;
381}
References IIccSparseMatrixEntry::get(), Init(), m_ColumnIndices, m_Data, m_nCols, m_nMaxEntries, m_nRows, m_RowStart, and IIccSparseMatrixEntry::set().
Referenced by CIccTagSparseMatrixArray::Interpolate().
◆ IsValid()
bool CIccSparseMatrix::IsValid |
( |
| ) |
|
◆ MaxEntries() [1/2]
static icUInt32Number MaxEntries(icUInt32Number nMemSize, icUInt16Number nRows, icUInt8Number nTypeSize)
Definition IccSparseMatrix.cpp:500
static icUInt8Number EntrySize(icSparseMatrixType nType)
Definition IccSparseMatrix.cpp:511
References EntrySize(), and MaxEntries().
◆ MaxEntries() [2/2]
◆ MemSize() [1/2]
static icUInt32Number MemSize(icUInt32Number nMaxEntries, icUInt16Number nRows, icUInt8Number nTypeSize)
Definition IccSparseMatrix.cpp:505
References EntrySize(), and MemSize().
◆ MemSize() [2/2]
506{
507 icUInt32Number off = ((4 + 4*(nRows+1) + 2*nMaxEntries + (nTypeSize-1))/nTypeSize)*nTypeSize;
508 return off + nTypeSize*nMaxEntries;
509}
Referenced by MemSize().
◆ MultiplyVector()
◆ operator=()
72{
76
80
84 break;
87 break;
90 break;
93 break;
96 default:
98 }
99 }
100
103 }
104 else {
108 }
109
110 return *this;
111}
References CIccSparseMatrixFloat16::CIccSparseMatrixFloat16(), CIccSparseMatrixFloat32::CIccSparseMatrixFloat32(), CIccSparseMatrixFloatNum::CIccSparseMatrixFloatNum(), CIccSparseMatrixUInt16::CIccSparseMatrixUInt16(), CIccSparseMatrixUInt8::CIccSparseMatrixUInt8(), icSparseMatrixFloat16, icSparseMatrixFloat32, icSparseMatrixUInt16, icSparseMatrixUInt8, Init(), m_Data, m_nCols, m_nMaxEntries, m_nRawSize, m_nRows, m_nType, and m_pMatrix.
◆ Reset()
114{
117
122
123 if (bInitFromData) {
127 }
128 else {
134 }
135}
References Init(), m_ColumnIndices, m_Data, m_nCols, m_nMaxEntries, m_nRawSize, m_nRows, m_nType, m_pMatrix, and m_RowStart.
Referenced by CIccTagSparseMatrixArray::GetSparseMatrix(), CIccTagXmlSparseMatrixArray::ParseXml(), CIccTagSparseMatrixArray::Read(), CIccTagXmlSparseMatrixArray::ToXml(), CIccTagSparseMatrixArray::Validate(), and CIccTagSparseMatrixArray::Write().
◆ Rows()
◆ Union()
385{
387 return false;
388
391 return false;
392 }
393
395 int r=0, i, j;
396 int fA, fB, nA, nB, offA, offB, iA, iB;
397
398 for (r=0; r<(int)
m_nRows; r++) {
403
405
406 if (nA && nB) {
407 i=j=0;
408
409 while(i<nA || j<nB) {
411 return false;
412
413 if (i<nA && j<nB) {
414 offA = fA+i;
415 offB = fB+j;
418
419 if (iA<iB) {
422 i++;
423 }
424 else if (iB<iA) {
427 j++;
428 }
429 else {
432 i++;
433 j++;
434 }
435 pos++;
436 }
437 else if (i<nA) {
438 offA = fA+i;
440
443 }
444 else {
445 offB = fB+j;
447
450 }
451 }
452 }
453 else if (nA) {
455 return false;
456
458
459 for (i=0; i<nA; i++) {
461 }
462 }
463 else if (nB) {
465 return false;
466
468
469 for (i=0; i<nB; i++) {
471 }
472 }
474 }
475
476 return true;
477}
References Init(), m_ColumnIndices, m_Data, m_nCols, m_nMaxEntries, m_nRows, m_RowStart, and IIccSparseMatrixEntry::set().
Referenced by CIccTagSparseMatrixArray::Validate().
◆ m_ColumnIndices
◆ m_Data
Referenced by CIccSparseMatrix(), CIccSparseMatrix(), ~CIccSparseMatrix(), Copy(), FillFromFullMatrix(), GetData(), Init(), Interp(), IsValid(), MultiplyVector(), operator=(), Reset(), and Union().
◆ m_nCols
Referenced by CIccSparseMatrix(), CIccSparseMatrix(), Cols(), Copy(), FillFromFullMatrix(), Init(), Interp(), IsValid(), operator=(), Reset(), and Union().
◆ m_nMaxEntries
◆ m_nRawSize
◆ m_nRows
Referenced by CIccSparseMatrix(), CIccSparseMatrix(), Copy(), FillFromFullMatrix(), GetNumEntries(), Init(), Interp(), IsValid(), MultiplyVector(), operator=(), Reset(), Rows(), and Union().
◆ m_nType
◆ m_pMatrix
◆ m_RowStart
Referenced by CIccSparseMatrix(), CIccSparseMatrix(), Copy(), FillFromFullMatrix(), GetColumnsForRow(), GetNumEntries(), GetNumRowColumns(), GetRowOffset(), GetRowStart(), Init(), Interp(), IsValid(), MultiplyVector(), Reset(), and Union().
The documentation for this class was generated from the following files: