vsum

Functions

int main(int argc, char *argv[])

vsum [ option ] [ infile ]

  • -l int

    • length of vector (1L)

  • -m int

    • order of vector (0L1)

  • -t int

    • output interval (1T)

  • infile str

    • double-type vectors

  • stdout

    • double-type summation

The input of this command is

x1(1),,x1(L)L,x2(1),,x2(L)L,,
and the output is
s0(1),,s0(L)L,sT(1),,sT(L)L,,
where
st(l)=τ=1Txt+τ(l).
If T is not given, the summation of the whole input is computed.

echo 0 1 2 3 4 5 6 7 8 9 | x2x +ad | vsum -l 2 | x2x +da
# 20
# 25

echo 0 1 2 3 4 5 6 7 | x2x +ad | vsum -l 2 -t 2 | x2x +da
# 2
# 4
# 10
# 12

Parameters
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns

0 on success, 1 on failure.

See also

average vstat