Changeset 439 in flair-src for trunk/lib/FlairCore/src/Matrix.cpp


Ignore:
Timestamp:
Aug 25, 2021, 1:13:36 PM (4 years ago)
Author:
Sanahuja Guillaume
Message:

refactor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/Matrix.cpp

    r318 r439  
    5353
    5454  void CopyData(char *dst) const {
    55     if (typeid(matrix->GetDataType().GetElementDataType()) ==
    56         typeid(FloatType)) {
     55    if (typeid(matrix->GetDataType().GetElementDataType()) == typeid(FloatType)) {
    5756      float value = matrix->Value(row, col);
    5857      memcpy(dst, &value, sizeof(value));
    59     } else if (typeid(matrix->GetDataType().GetElementDataType()) ==
    60                typeid(SignedIntegerType)) {
     58    } else if (typeid(matrix->GetDataType().GetElementDataType()) ==  typeid(SignedIntegerType)) {
    6159      switch (matrix->GetDataType().GetElementDataType().GetSize()) {
    6260      case 1: {
     
    6967      } break;
    7068      }
    71     } else if (typeid(matrix->GetDataType().GetElementDataType()) ==
    72                typeid(UnsignedIntegerType)) {
     69    } else if (typeid(matrix->GetDataType().GetElementDataType()) == typeid(UnsignedIntegerType)) {
    7370      switch (matrix->GetDataType().GetElementDataType().GetSize()) {
    7471      case 1: {
     
    10097  for (uint32_t i = 0; i < rows; i++) {
    10198    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);
    104100      SetValue(i, j, 0);
    105101    }
     
    141137  float value;
    142138
    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()) {
    145140    Warn("index (%i,%i) out of bound, max (%i,%i)\n", row, col,
    146141         pimpl_->descriptor->Rows() - 1, pimpl_->descriptor->Cols() - 1);
     
    156151
    157152float 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()) {
    160154    Warn("index (%i,%i) out of bound, max (%i,%i)\n", row, col,
    161155         pimpl_->descriptor->Rows() - 1, pimpl_->descriptor->Cols() - 1);
     
    167161
    168162void 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()) {
    171164    Warn("index (%i,%i) out of bound, max (%i,%i)\n", row, col,
    172165         pimpl_->descriptor->Rows() - 1, pimpl_->descriptor->Cols() - 1);
     
    179172
    180173void 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()) {
    183175    Warn("index (%i,%i) out of bound, max (%i,%i)\n", row, col,
    184176         pimpl_->descriptor->Rows() - 1, pimpl_->descriptor->Cols() - 1);
Note: See TracChangeset for help on using the changeset viewer.