mirror of
https://github.com/jlengrand/LAFF.git
synced 2026-03-10 08:31:21 +00:00
Create Dot_unb
* Also add octaverc to add paths and silence warnings
This commit is contained in:
2
.octaverc
Normal file
2
.octaverc
Normal file
@@ -0,0 +1,2 @@
|
||||
warning('off', 'Octave:possible-matlab-short-circuit-operator');
|
||||
addpath(genpath ('/Users/jlengrand/IdeaProjects/LAFF-2.0xM/Programming/laff'))
|
||||
61
Homework/Week1/Dot_unb.m
Normal file
61
Homework/Week1/Dot_unb.m
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user