mcpp index

compat.richdem

#include

High-performance terrain analysis library

#include <richdem/common/Array2D.hpp>
mcpp add compat.richdem@2.2.11

用法

来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。

#include <richdem/common/Array2D.hpp>
#include <richdem/common/random.hpp>
#include <richdem/depressions/depressions.hpp>

int main() {
    richdem::Array2D<double> dem(3, 3, 5.0);
    dem(1, 1) = 1.0;
    richdem::FillDepressions<richdem::Topology::D8>(dem);
    if (dem(1, 1) != 5.0 || dem(0, 0) != 5.0) return 1;

    richdem::seed_rand(1);
    const auto state = richdem::SaveRandomState();
    const int first = richdem::uniform_rand_int(1, 10);
    richdem::SetRandomState(state);
    return first >= 1 && first <= 10 &&
           richdem::uniform_rand_int(1, 10) == first ? 0 : 2;
}

tests/examples/richdem/tests/core.cpp · 项目 tests/examples/richdem

构建

targets
richdem (lib)
language
c++23
C standard
c11
import std
no
include dirs
*/include

源文件 (4)

  • */src/richdem.cpp
  • */src/random.cpp
  • */src/terrain_generation/terrain_generation.cpp
  • */src/terrain_generation/PerlinNoise.cpp

版本

版本平台 镜像sha256
2.2.11 最新 LinuxWindowsmacOS 源站 bfa98d00d1d1…