Skip to content

Commit

Permalink
run v fmt -w . again
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Aug 10, 2024
1 parent 665fa11 commit 7c55411
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 80 deletions.
68 changes: 34 additions & 34 deletions errors/errno.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion gm/bins.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 4 additions & 4 deletions iter/ranges.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions la/sparse_config.v
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down
2 changes: 1 addition & 1 deletion ml/data.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions ml/kmeans.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ml/linreg.v
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
26 changes: 13 additions & 13 deletions ml/workspace.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions plot/axis.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 14 additions & 14 deletions plot/trace.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7c55411

Please sign in to comment.