Changeset 1130 for cpp/frams/genetics/fB


Ignore:
Timestamp:
04/16/21 15:55:34 (4 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

Location:
cpp/frams/genetics/fB
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/fB/fB_conv.cpp

    r973 r1130  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    77#include <frams/param/paramobj.h>
    88#include <vector>
     9#include <algorithm>
    910#include <frams/util/multimap.h>
    1011#include "fB_general.h"
     
    250251                                double mn, mx, def;
    251252                                par.getMinMaxDouble(propindex, mn, mx, def);
    252                                 par.setDouble(propindex, min(mx, max(mn, (mx - mn) * val + mn)));
     253                                par.setDouble(propindex, std::min(mx, std::max(mn, (mx - mn) * val + mn)));
    253254                        }
    254255                        propindex++;
  • cpp/frams/genetics/fB/fB_oper.cpp

    r999 r1130  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2021  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
    55#include <frams/util/sstring.h>
    66#include <vector>
     7#include <algorithm>
    78#include <frams/param/param.h>
    89#include "fB_conv.h"
     
    461462        {
    462463                // get maximal count of genes from both parents
    463                 int maxgenecount = max(fB_GenoHelpers::geneCountNoNested(parent1),
     464                int maxgenecount = std::max(fB_GenoHelpers::geneCountNoNested(parent1),
    464465                        fB_GenoHelpers::geneCountNoNested(parent2));
    465466
Note: See TracChangeset for help on using the changeset viewer.