Ignore:
Timestamp:
04/16/21 15:55:34 (3 years ago)
Author:
Maciej Komosinski
Message:

Used std::min(), std::max() explicitly to avoid compiler confusion. Used std::size() explicitly instead of the equivalent macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/neuro/impl/neuroimpl-channels.cpp

    r907 r1130  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
    55#include "neuroimpl-channels.h"
    6 #include <common/nonstd_stl.h>
     6#include <algorithm>
    77
    88void NI_Channelize::go()
     
    1818        if (c < 2) { setState(getWeightedInputState(1)); return; }
    1919        double s = getWeightedInputState(0);
    20         s = (max(-1.0, min(1.0, s)) + 1.0) / 2.0; // 0..1
     20        s = (std::max(-1.0, std::min(1.0, s)) + 1.0) / 2.0; // 0..1
    2121        int i1;
    22         i1 = (int)(s * (c - 1)); i1 = max(0, min(i1, c - 2));
     22        i1 = (int)(s * (c - 1)); i1 = std::max(0, std::min(i1, c - 2));
    2323        double sw = 1.0 / (c - 1);
    2424        double s1 = sw * i1;
Note: See TracChangeset for help on using the changeset viewer.