diff --git a/.octaverc b/.octaverc new file mode 100644 index 0000000..8b05f90 --- /dev/null +++ b/.octaverc @@ -0,0 +1,2 @@ +warning('off', 'Octave:possible-matlab-short-circuit-operator'); +addpath(genpath ('/Users/jlengrand/IdeaProjects/LAFF-2.0xM/Programming/laff')) \ No newline at end of file diff --git a/Homework/Week1/Dot_unb.m b/Homework/Week1/Dot_unb.m new file mode 100644 index 0000000..30ea937 --- /dev/null +++ b/Homework/Week1/Dot_unb.m @@ -0,0 +1,61 @@ +% Copyright 2018 The University of Texas at Austin +% +% For licensing information see +% http://www.cs.utexas.edu/users/flame/license.html +% +% Programmed by: Julien Lengrand-Lambert +% julien@lengrand.fr + +function [ alpha_out, x_out, c_out ] = Dot_unb( alpha, x, c ) + + alpha = 0; + + [ xT, ... + xB ] = FLA_Part_2x1( x, ... + 0, 'FLA_TOP' ); + + [ cT, ... + cB ] = FLA_Part_2x1( c, ... + 0, 'FLA_TOP' ); + + while ( size( xT, 1 ) < size( x, 1 ) ) + + [ x0, ... + chi1, ... + x2 ] = FLA_Repart_2x1_to_3x1( xT, ... + xB, ... + 1, 'FLA_BOTTOM' ); + + [ c0, ... + gamma1, ... + c2 ] = FLA_Repart_2x1_to_3x1( cT, ... + cB, ... + 1, 'FLA_BOTTOM' ); + + alpha += chi1 * gamma1; + + + [ xT, ... + xB ] = FLA_Cont_with_3x1_to_2x1( x0, ... + chi1, ... + x2, ... + 'FLA_TOP' ); + + [ cT, ... + cB ] = FLA_Cont_with_3x1_to_2x1( c0, ... + gamma1, ... + c2, ... + 'FLA_TOP' ); + + end + + alpha_out = alpha; + + + x_out = [ xT + xB ]; + + c_out = [ cT + cB ]; + +endfunction \ No newline at end of file