use lib ".";
use SparseVector;

tie my @x, SparseVector;
tie my @y, SparseVector;

$x[1]=17;
$x[17]=1;

$y[1]=3;
$y[3]=7;
$y[17]=6;

# Get the tied objects
$x = tied @x;
$y = tied @y;
$z = tied @z;

print "x is ", $x, "\n";
print "y is ", $y, "\n";

# Perform overloaded multiplicaton (dot product)
$w = $x * $y;

print "Dot product x by y is " , $w, "\n";

# Perform overloaded multiplicaton (scalar product)
$w = 2 * $y;

print "Scalar product y by 2 is ", $w, "\n";

untie @x;
untie @y;

