From 7c55411180dca2d30a3c3072d3629fb00aabaaef Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 10 Aug 2024 14:44:08 +0300 Subject: [PATCH] run `v fmt -w .` again --- errors/errno.v | 68 +++++++++++++++++++++++----------------------- gm/bins.v | 2 +- iter/ranges.v | 8 +++--- la/sparse_config.v | 8 +++--- ml/data.v | 2 +- ml/kmeans.v | 6 ++-- ml/linreg.v | 2 +- ml/workspace.v | 26 +++++++++--------- plot/axis.v | 10 +++---- plot/trace.v | 28 +++++++++---------- 10 files changed, 80 insertions(+), 80 deletions(-) diff --git a/errors/errno.v b/errors/errno.v index accf1083c..d958ee0b6 100644 --- a/errors/errno.v +++ b/errors/errno.v @@ -2,73 +2,73 @@ module errors pub enum ErrorCode { // success - success = 0 + success = 0 // generic failure - failure = -1 + failure = -1 // iteration has not converged can_continue = -2 // input domain error, e.g sqrt(-1) - edom = 1 + edom = 1 // output range error, e.g. exp(1e+100) - erange = 2 + erange = 2 // invalid pointer - efault = 3 + efault = 3 // invalid argument supplied by user - einval = 4 + einval = 4 // generic failure - efailed = 5 + efailed = 5 // factorization failed - efactor = 6 + efactor = 6 // sanity check failed - shouldn't happen - esanity = 7 + esanity = 7 // malloc failed - enomem = 8 + enomem = 8 // problem with user-supplied function - ebadfunc = 9 + ebadfunc = 9 // iterative process is out of control - erunaway = 10 + erunaway = 10 // exceeded max number of iterations - emaxiter = 11 + emaxiter = 11 // tried to divide by zero - ezerodiv = 12 + ezerodiv = 12 // user specified an invalid tolerance - ebadtol = 13 + ebadtol = 13 // failed to reach the specified tolerance - etol = 14 + etol = 14 // underflow - eundrflw = 15 + eundrflw = 15 // overflow - eovrflw = 16 + eovrflw = 16 // loss of accuracy - eloss = 17 + eloss = 17 // failed because of roundoff error - eround = 18 + eround = 18 // matrix, vector lengths are not conformant - ebadlen = 19 + ebadlen = 19 // matrix not square - enotsqr = 20 + enotsqr = 20 // apparent singularity detected - esing = 21 + esing = 21 // integral or series is divergent - ediverge = 22 + ediverge = 22 // requested feature is not supported by the hardware - eunsup = 23 + eunsup = 23 // requested feature not (yet) implemented - eunimpl = 24 + eunimpl = 24 // cache limit exceeded - ecache = 25 + ecache = 25 // table limit exceeded - etable = 26 + etable = 26 // iteration is not making progress towards solution - enoprog = 27 + enoprog = 27 // jacobian evaluations are not improving the solution - enoprogj = 28 + enoprogj = 28 // cannot reach the specified tolerance in F - etolf = 29 + etolf = 29 // cannot reach the specified tolerance in X - etolx = 30 + etolx = 30 // cannot reach the specified tolerance in gradient - etolg = 31 + etolg = 31 // end of file - eof = 32 + eof = 32 } diff --git a/gm/bins.v b/gm/bins.v index c4f0a6026..5cffe7cf3 100644 --- a/gm/bins.v +++ b/gm/bins.v @@ -18,7 +18,7 @@ pub mut: @[heap] pub struct Bin { pub mut: - index int // index of bin + index int // index of bin entries []&BinEntry // entries } diff --git a/iter/ranges.v b/iter/ranges.v index 23f28096c..27e48b6b6 100644 --- a/iter/ranges.v +++ b/iter/ranges.v @@ -129,8 +129,8 @@ pub: @[params] pub struct LinearIterParams { pub: - start f64 @[required] - stop f64 @[required] + start f64 @[required] + stop f64 @[required] len i64 = 50 endpoint bool = true } @@ -193,8 +193,8 @@ mut: @[params] pub struct LogIterParams { - start f64 @[required] - stop f64 @[required] + start f64 @[required] + stop f64 @[required] len i64 = 50 base f64 = 10.0 endpoint bool = true diff --git a/la/sparse_config.v b/la/sparse_config.v index 66ac022dc..9c2271d0a 100644 --- a/la/sparse_config.v +++ b/la/sparse_config.v @@ -7,10 +7,10 @@ import vsl.mpi pub struct SparseConfig { mut: communicator ?&mpi.Communicator // MPI communicator for parallel solvers [may be none] - mumps_ordering int // ICNTL(7) default = "" == "auto" - mumps_scaling int // Scaling type (check MUMPS solver) [may be empty] - symmetric bool // indicates symmetric system. NOTE: when using MUMPS, only the upper or lower part of the matrix must be provided - sym_pos_def bool // indicates symmetric-positive-defined system. NOTE: when using MUMPS, only the upper or lower part of the matrix must be provided + mumps_ordering int // ICNTL(7) default = "" == "auto" + mumps_scaling int // Scaling type (check MUMPS solver) [may be empty] + symmetric bool // indicates symmetric system. NOTE: when using MUMPS, only the upper or lower part of the matrix must be provided + sym_pos_def bool // indicates symmetric-positive-defined system. NOTE: when using MUMPS, only the upper or lower part of the matrix must be provided pub mut: verbose bool // run on verbose mode mumps_increase_of_working_space_pct int // MUMPS control parameters (check MUMPS solver manual) ICNTL(14) default = 100% diff --git a/ml/data.v b/ml/data.v index 273d3c47b..1a186bca2 100644 --- a/ml/data.v +++ b/ml/data.v @@ -26,7 +26,7 @@ pub mut: nb_samples int // number of data points (samples). number of rows in x and y nb_features int // number of features. number of columns in x x &la.Matrix[T] = unsafe { nil } // [nb_samples][nb_features] x values - y []T // [nb_samples] y values [optional] + y []T // [nb_samples] y values [optional] } // Data.new returns a new object to hold ML data diff --git a/ml/kmeans.v b/ml/kmeans.v index 9e869916a..87c39f583 100644 --- a/ml/kmeans.v +++ b/ml/kmeans.v @@ -9,12 +9,12 @@ import vsl.plot @[heap] pub struct Kmeans { mut: - name string // name of this "observer" + name string // name of this "observer" data &Data[f64] = unsafe { nil } // x data stat &Stat[f64] = unsafe { nil } // statistics about x (data) - nb_classes int // expected number of classes + nb_classes int // expected number of classes bins &gm.Bins = unsafe { nil } // "bins" to speed up searching for data points given their coordinates (2D or 3D only at the moment) - nb_iter int // number of iterations + nb_iter int // number of iterations pub mut: classes []int // [nb_samples] indices of classes of each sample centroids [][]f64 // [nb_classes][nb_features] coordinates of centroids diff --git a/ml/linreg.v b/ml/linreg.v index 65b0ae9e3..20b1cf98a 100644 --- a/ml/linreg.v +++ b/ml/linreg.v @@ -9,7 +9,7 @@ import vsl.util pub struct LinReg { mut: // main - name string // name of this "observer" + name string // name of this "observer" data &Data[f64] = unsafe { nil } // x-y data // workspace e []f64 // vector e = b⋅o + x⋅theta - y [nb_samples] diff --git a/ml/workspace.v b/ml/workspace.v index 52810d4bd..110d03640 100644 --- a/ml/workspace.v +++ b/ml/workspace.v @@ -12,19 +12,19 @@ import vsl.la pub struct Stat[T] { pub mut: data &Data[T] = unsafe { nil } // data - name string // name of this object - min_x []T // [n_features] min x values - max_x []T // [n_features] max x values - sum_x []T // [n_features] sum of x values - mean_x []T // [n_features] mean of x values - sig_x []T // [n_features] standard deviations of x - del_x []T // [n_features] difference: max(x) - min(x) - min_y T // min of y values - max_y T // max of y values - sum_y T // sum of y values - mean_y T // mean of y values - sig_y T // standard deviation of y - del_y T // difference: max(y) - min(y) + name string // name of this object + min_x []T // [n_features] min x values + max_x []T // [n_features] max x values + sum_x []T // [n_features] sum of x values + mean_x []T // [n_features] mean of x values + sig_x []T // [n_features] standard deviations of x + del_x []T // [n_features] difference: max(x) - min(x) + min_y T // min of y values + max_y T // max of y values + sum_y T // sum of y values + mean_y T // mean of y values + sig_y T // standard deviation of y + del_y T // difference: max(y) - min(y) } // stat returns a new Stat object diff --git a/plot/axis.v b/plot/axis.v index 731d59697..29488a525 100644 --- a/plot/axis.v +++ b/plot/axis.v @@ -5,11 +5,11 @@ pub struct Axis { pub mut: title AxisTitle tickmode string = 'auto' - tick0 f64 @[omitempty] - dtick f64 @[omitempty] - tickvals []f64 @[omitempty] - ticktext []string @[omitempty] - range []f64 @[omitempty] + tick0 f64 @[omitempty] + dtick f64 @[omitempty] + tickvals []f64 @[omitempty] + ticktext []string @[omitempty] + range []f64 @[omitempty] } // AxisTitle handles needed data to render an axis title diff --git a/plot/trace.v b/plot/trace.v index 705ced8df..f1bb44516 100644 --- a/plot/trace.v +++ b/plot/trace.v @@ -26,20 +26,20 @@ pub struct CommonTrace { pub mut: x XType xbins map[string]f32 - y YType @[omitempty] - z ZType @[omitempty] - name string @[omitempty] - mode string @[omitempty] - marker Marker @[omitempty] - line Line @[omitempty] - pull []f64 @[omitempty] - hole f64 @[omitempty] - fill string @[omitempty] - fillcolor string @[omitempty] - customdata [][]string @[omitempty] - colorscale string = 'Viridis' @[omitempty] - textinfo string @[omitempty] - text []string @[omitempty] + y YType @[omitempty] + z ZType @[omitempty] + name string @[omitempty] + mode string @[omitempty] + marker Marker @[omitempty] + line Line @[omitempty] + pull []f64 @[omitempty] + hole f64 @[omitempty] + fill string @[omitempty] + fillcolor string @[omitempty] + customdata [][]string @[omitempty] + colorscale string = 'Viridis' @[omitempty] + textinfo string @[omitempty] + text []string @[omitempty] } // ScatterTrace is a struct for Scatter trace type