Menu

#618 TIP#363 - vector math, partial reference implementation

TIP Implementation
open
5
2010-07-06
2010-07-06
No

Implements vector-vector, vector-scalar, and scalar-vector add/sub/mul/div in expr.

Very minor impact on core execution. Two files touched in generic:

tclInt.h -- added a couple of macros to help processing lists of numbers

tclExecute.c -- added vector-vector and vector-scalar handling per above

Compiles & runs with 8.6b1.

VTest.tcl exercises the mods. Printf's show where the code is running....

Handles stuff like:

set V [list 5 4 3 2 1]
set W [list 1 2 3 4 5]

expr {$V + $W}

set X 10

expr {$V * $X}

expr {$X / $V}

Discussion

  • Karl C. Hansen

    Karl C. Hansen - 2010-07-06

    Modified from 8.6b1

     
  • Karl C. Hansen

    Karl C. Hansen - 2010-07-06

    Modified from 8.6b1

     
  • Karl C. Hansen

    Karl C. Hansen - 2010-07-06

    Test script for vector-vector, vector-scalar, and scalar-vector ops

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.