Changeset 439 in flair-src for trunk/lib/FlairCore/src/Matrix.cpp
- Timestamp:
- Aug 25, 2021, 1:13:36 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/Matrix.cpp
r318 r439 53 53 54 54 void CopyData(char *dst) const { 55 if (typeid(matrix->GetDataType().GetElementDataType()) == 56 typeid(FloatType)) { 55 if (typeid(matrix->GetDataType().GetElementDataType()) == typeid(FloatType)) { 57 56 float value = matrix->Value(row, col); 58 57 memcpy(dst, &value, sizeof(value)); 59 } else if (typeid(matrix->GetDataType().GetElementDataType()) == 60 typeid(SignedIntegerType)) { 58 } else if (typeid(matrix->GetDataType().GetElementDataType()) == typeid(SignedIntegerType)) { 61 59 switch (matrix->GetDataType().GetElementDataType().GetSize()) { 62 60 case 1: { … … 69 67 } break; 70 68 } 71 } else if (typeid(matrix->GetDataType().GetElementDataType()) == 72 typeid(UnsignedIntegerType)) { 69 } else if (typeid(matrix->GetDataType().GetElementDataType()) == typeid(UnsignedIntegerType)) { 73 70 switch (matrix->GetDataType().GetElementDataType().GetSize()) { 74 71 case 1: { … … 100 97 for (uint32_t i = 0; i < rows; i++) { 101 98 for (uint32_t j = 0; j < cols; j++) { 102 AppendLogDescription(pimpl_->descriptor->ElementName(i, j), 103 elementDataType); 99 AppendLogDescription(pimpl_->descriptor->ElementName(i, j),elementDataType); 104 100 SetValue(i, j, 0); 105 101 } … … 141 137 float value; 142 138 143 if (row >= (uint32_t)pimpl_->descriptor->Rows() || 144 col >= (uint32_t)pimpl_->descriptor->Cols()) { 139 if (row >= (uint32_t)pimpl_->descriptor->Rows() || col >= (uint32_t)pimpl_->descriptor->Cols()) { 145 140 Warn("index (%i,%i) out of bound, max (%i,%i)\n", row, col, 146 141 pimpl_->descriptor->Rows() - 1, pimpl_->descriptor->Cols() - 1); … … 156 151 157 152 float Matrix::ValueNoMutex(uint32_t row, uint32_t col) const { 158 if (row >= (uint32_t)pimpl_->descriptor->Rows() || 159 col >= (uint32_t)pimpl_->descriptor->Cols()) { 153 if (row >= (uint32_t)pimpl_->descriptor->Rows() || col >= (uint32_t)pimpl_->descriptor->Cols()) { 160 154 Warn("index (%i,%i) out of bound, max (%i,%i)\n", row, col, 161 155 pimpl_->descriptor->Rows() - 1, pimpl_->descriptor->Cols() - 1); … … 167 161 168 162 void Matrix::SetValue(uint32_t row, uint32_t col, float value) { 169 if (row >= (uint32_t)pimpl_->descriptor->Rows() || 170 col >= (uint32_t)pimpl_->descriptor->Cols()) { 163 if (row >= (uint32_t)pimpl_->descriptor->Rows() || col >= (uint32_t)pimpl_->descriptor->Cols()) { 171 164 Warn("index (%i,%i) out of bound, max (%i,%i)\n", row, col, 172 165 pimpl_->descriptor->Rows() - 1, pimpl_->descriptor->Cols() - 1); … … 179 172 180 173 void Matrix::SetValueNoMutex(uint32_t row, uint32_t col, float value) { 181 if (row >= (uint32_t)pimpl_->descriptor->Rows() || 182 col >= (uint32_t)pimpl_->descriptor->Cols()) { 174 if (row >= (uint32_t)pimpl_->descriptor->Rows() || col >= (uint32_t)pimpl_->descriptor->Cols()) { 183 175 Warn("index (%i,%i) out of bound, max (%i,%i)\n", row, col, 184 176 pimpl_->descriptor->Rows() - 1, pimpl_->descriptor->Cols() - 1);
Note:
See TracChangeset
for help on using the changeset viewer.