You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.8 KiB
C
73 lines
1.8 KiB
C
|
1 month ago
|
/*------------------------------------------------------------------------------
|
||
|
|
* Copyright (c) 2023 by Bai Bing (seread@163.com)
|
||
|
|
* See COPYING file for copying and redistribution conditions.
|
||
|
|
*
|
||
|
|
* Alians IT Studio.
|
||
|
|
*----------------------------------------------------------------------------*/
|
||
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <any>
|
||
|
|
#include <cmath>
|
||
|
|
#include <map>
|
||
|
|
#include <string>
|
||
|
|
#include <utility>
|
||
|
|
|
||
|
|
namespace ais
|
||
|
|
{
|
||
|
|
// parameters for example application running.
|
||
|
|
struct Settings
|
||
|
|
{
|
||
|
|
// real sample points
|
||
|
|
std::string randomsFilename;
|
||
|
|
std::string concernPointsFilename;
|
||
|
|
std::string breaklinesFilename;
|
||
|
|
std::string faultsFilename;
|
||
|
|
std::string outputFilename{"output.grd"};
|
||
|
|
|
||
|
|
// mock random points
|
||
|
|
bool useMockRandoms = false;
|
||
|
|
size_t mockRandomCount = 200;
|
||
|
|
|
||
|
|
size_t xCount = 101;
|
||
|
|
size_t yCount = 101;
|
||
|
|
|
||
|
|
double targetXGridSize = std::nan("1");
|
||
|
|
double targetYGridSize = std::nan("1");
|
||
|
|
|
||
|
|
int estimateFactor = 0;
|
||
|
|
int16_t cornerWeight = 64;
|
||
|
|
|
||
|
|
size_t maxIteration{20000};
|
||
|
|
double residual{0.0001};
|
||
|
|
double fillValue{0.0};
|
||
|
|
|
||
|
|
bool useMultiThread{true};
|
||
|
|
|
||
|
|
int8_t faultEdgeLevel{-1};
|
||
|
|
|
||
|
|
std::map<std::string, std::any> params();
|
||
|
|
};
|
||
|
|
|
||
|
|
#define no_argument 0
|
||
|
|
#define required_argument 1
|
||
|
|
#define optional_argument 2
|
||
|
|
|
||
|
|
struct option
|
||
|
|
{
|
||
|
|
const char *name;
|
||
|
|
int has_arg;
|
||
|
|
int *flag;
|
||
|
|
int val;
|
||
|
|
};
|
||
|
|
|
||
|
|
// default options definition
|
||
|
|
extern const char *shortopts;
|
||
|
|
extern char *optarg2;
|
||
|
|
extern const option longopts[];
|
||
|
|
|
||
|
|
void usage(const char *app);
|
||
|
|
|
||
|
|
int getopt_long_2(int argc, char **argv, const char *shortopts, const option *longopts, int *longind,
|
||
|
|
char **optarg);
|
||
|
|
|
||
|
|
} // namespace ais
|