Commit bed57b72 authored by Mathieu Faverge's avatar Mathieu Faverge

Merge branch 'hotfix/factorize' into 'master'

Factorize code

See merge request !15
parents 2f7fceb0 0fd12286
......@@ -37,12 +37,12 @@ hqr_test:
untracked: true
script:
- source install/bin/hqr_env.sh
- cd build
- ctest -D ExperimentalTest
- (cd build &&
eval "ctest -D ExperimentalTest
-D ExperimentalCoverage
-D ExperimentalSubmit | tee ../hqr-tests.log
- lcov --directory . --capture --output-file ../hqr.lcov
- lcov --summary ../hqr.lcov | tee -a ../hqr-gcov.log
-D ExperimentalSubmit | tee ../hqr-tests.log")
- lcov --directory . --capture --output-file hqr.lcov
- lcov --summary hqr.lcov | tee -a hqr-gcov.log
hqr_sonar:
stage: sonar
......@@ -59,8 +59,8 @@ hqr_sonar:
- sonar.log
script:
- ./analysis.sh
only:
- master@solverstack/hqr
# only:
# - master@solverstack/hqr
# pages:
# stage: deploy
......
###
#
# @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
# @copyright 2017-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
# Univ. Bordeaux. All rights reserved.
#
# @version 0.1.0
......@@ -100,6 +100,7 @@ set(srcs
src/check.c
src/gendot.c
src/gensvg.c
src/print.c
src/queue.c
)
......
This diff is collapsed.
This diff is collapsed.
......@@ -25,11 +25,14 @@ cat ./hqr-gcov.log
export UNDEFINITIONS="-UWIN32 -UWIN64 -U_MSC_EXTENSIONS -U_MSC_VER -U__SUNPRO_C -U__SUNPRO_CC -U__sun -Usun -U__cplusplus"
# run cppcheck analysis
cppcheck -v -f --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingInclude ${UNDEFINITIONS} --file-list=./filelist.txt 2> hqr-cppcheck.xml
cppcheck -v -f --project=build/compile_commands.json --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingInclude ${UNDEFINITIONS} ${DEFINITIONS} --file-list=./filelist.txt 2> hqr-cppcheck.xml
# run rats analysis
rats -w 3 --xml `cat filelist.txt` > hqr-rats.xml
# Set the default for the project key
SONARQUBE_PROJECTKEY=${SONARQUBE_PROJECTKEY:-hiepacs:hqr:gitlab:master}
# create the sonarqube config file
cat > sonar-project.properties << EOF
sonar.host.url=https://sonarqube.bordeaux.inria.fr/sonarqube
......@@ -40,7 +43,7 @@ sonar.links.scm=https://gitlab.inria.fr/solverstack/hqr.git
sonar.links.ci=https://gitlab.inria.fr/solverstack/hqr/pipelines
sonar.links.issue=https://gitlab.inria.fr/solverstack/hqr/issues
sonar.projectKey=hiepacs:hqr:gitlab:master
sonar.projectKey=$SONARQUBE_PROJECTKEY
sonar.projectDescription=Library for hierarchical QR/LQ reduction trees
sonar.projectVersion=master
......@@ -48,6 +51,7 @@ sonar.language=c
sonar.sources=include, src, testings
sonar.inclusions=`cat filelist.txt | xargs echo | sed 's/ /, /g'`
sonar.sourceEncoding=UTF-8
sonar.c.errorRecoveryEnabled=true
sonar.c.compiler.charset=UTF-8
sonar.c.compiler.parser=GCC
sonar.c.compiler.regex=^(.*):(\\d+):\\d+: warning: (.*)\\[(.*)\\]$
......
#
# @file hqr_env.sh
#
# @copyright 2016-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
# @copyright 2016-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
# Univ. Bordeaux. All rights reserved.
#
# @version 6.0.0
......
......@@ -6,7 +6,7 @@
* of Tennessee Research Foundation. All rights
* reserved.
*
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
......@@ -18,24 +18,10 @@
#ifndef _libhqr_h_
#define _libhqr_h_
#ifdef BEGIN_C_DECLS
#undef BEGIN_C_DECLS
#endif
#ifdef END_C_DECLS
#undef END_C_DECLS
#endif
#if defined(c_plusplus) || defined(__cplusplus)
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
#else
# define BEGIN_C_DECLS /* empty */
# define END_C_DECLS /* empty */
extern "C" {
#endif
BEGIN_C_DECLS
/**
* @brief Define which tree level the tile belongs to.
*
......@@ -237,7 +223,7 @@ void libhqr_walk_stepk( const libhqr_tree_t *qrtree, int k, int *tiles );
* @name Drawing functions
* @{
*/
void libhqr_print_dag( const libhqr_tree_t *qrtree,
void libhqr_print_dot( const libhqr_tree_t *qrtree,
const char *filename );
void libhqr_print_svg( const libhqr_tree_t *qrtree,
const char *filename );
......@@ -247,19 +233,20 @@ void libhqr_print_svg( const libhqr_tree_t *qrtree,
* @name Checking/Debugging functions
* @{
*/
int libhqr_check ( const libhqr_matrix_t *A, const libhqr_tree_t *qrtree );
void libhqr_print_type ( const libhqr_matrix_t *A, const libhqr_tree_t *qrtree );
void libhqr_print_pivot ( const libhqr_matrix_t *A, const libhqr_tree_t *qrtree );
void libhqr_print_nbgeqrt( const libhqr_matrix_t *A, const libhqr_tree_t *qrtree );
void libhqr_print_perm ( const libhqr_matrix_t *A, const libhqr_tree_t *qrtree, int *perm );
void libhqr_print_next_k ( const libhqr_matrix_t *A, const libhqr_tree_t *qrtree, int k );
void libhqr_print_prev_k ( const libhqr_matrix_t *A, const libhqr_tree_t *qrtree, int k );
void libhqr_print_geqrt_k( const libhqr_matrix_t *A, const libhqr_tree_t *qrtree, int k );
int libhqr_check ( const libhqr_tree_t *qrtree );
void libhqr_print_type ( const libhqr_tree_t *qrtree );
void libhqr_print_pivot ( const libhqr_tree_t *qrtree );
void libhqr_print_nbgeqrt( const libhqr_tree_t *qrtree );
void libhqr_print_next_k ( const libhqr_tree_t *qrtree, int k );
void libhqr_print_prev_k ( const libhqr_tree_t *qrtree, int k );
void libhqr_print_geqrt_k( const libhqr_tree_t *qrtree, int k );
/**
* @}
*/
END_C_DECLS
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* _libhqr_h_ */
/**
*
* @file libhqr.h
* @file libhqr_internal.h
*
* @copyright 2010-2017 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
*
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
......@@ -24,9 +24,9 @@
#define PRINT_PIVGEN 0
#ifdef PRINT_PIVGEN
#define myassert( test ) {if ( ! (test) ) return -1;}
#define myassert( test ) do { if ( ! (test) ) { return -1; } } while(0)
#else
#define myassert(test) {assert((test)); return -1;}
#define myassert(test) do { assert((test)); return -1; } while(0)
#endif
#if defined(LIBHQR_HAVE_FALLTHROUGH)
......@@ -56,11 +56,8 @@ typedef struct hqr_subpiv_s hqr_subpiv_t;
* @brief Argument structure to store the high and low level trees used in the hierarchical reduction tree
*/
struct hqr_args_s {
int domino; /**< Switch to enable/disable the domino tree linking high and lw level reduction trees */
int tsrr; /**< Switch to enable/disable round-robin on TS to optimise pipelining between TS and local tree */
hqr_subpiv_t *llvl;
hqr_subpiv_t *hlvl;
int *perm;
hqr_subpiv_t *llvl; /**< Pointer to the low level tree data structure (shared memory) */
hqr_subpiv_t *hlvl; /**< Pointer to the high level tree data structure (distributed memory) */
};
struct hqr_subpiv_s {
......@@ -73,7 +70,7 @@ struct hqr_subpiv_s {
* @return the annihilator p used with m at step k
*/
int (*currpiv)(const hqr_subpiv_t *arg, int k, int m);
/*
/**
* nextpiv
* @param[in] arg pointer to the qr_piv structure
* @param[in] k step in the factorization
......@@ -85,7 +82,7 @@ struct hqr_subpiv_s {
* mt if p will never be used again as an annihilator.
*/
int (*nextpiv)(const hqr_subpiv_t *arg, int k, int p, int m);
/*
/**
* prevpiv
* @param[in] arg pointer to the qr_piv structure
* @param[in] k step in the factorization
......@@ -97,12 +94,12 @@ struct hqr_subpiv_s {
* mt if p has never been used before that as an annihilator.
*/
int (*prevpiv)(const hqr_subpiv_t *arg, int k, int p, int m);
int *ipiv;
int minMN;
int ldd;
int a;
int p;
int domino;
int *ipiv; /**< Pivot array for tree that uses pre-computed information */
int minMN; /**< Minimum tile numbers min(A->mt, A->nt) */
int ldd; /**< Leading dimension of the local subtree */
int a; /**< a parameter of the subtree to define the set of tiles killes by TS */
int p; /**< p parameter defining the number od distributed processes */
int domino; /**< domino switch to enable the domino tree in distributed */
};
/**
......@@ -129,24 +126,35 @@ typedef struct libhqr_tile_args_s {
step when it is not possible to compute them */
} libhqr_tile_args_t;
/**
* @brief Return the minimum of two integers
*/
static inline int libhqr_imin(int a, int b){
return (a > b) ? b : a;
}
/**
* @brief Return the maximum of two integers
*/
static inline int libhqr_imax(int a, int b){
return (a > b) ? a : b;
}
/**
* @brief Return ceil division of two integers
*/
static inline int libhqr_iceil(int a, int b){
return (a + b - 1) / b;
}
/* Number of extra tile of type 1 between the tile of type 3 and the first of nb11 */
/**
* @brief Number of extra tile of type 1 between the tile of type 3 and the first of nb11
*/
#define nbextra1_formula (( (k % pa) > (pa - p) ) ? (-k)%pa + pa : 0)
/*
* function for drawing the tree
/**
* @name Drawing functions
* @{
*/
void draw_rectangle(int k, int p, int m, int step_m, FILE *file);
void draw_lines(const libhqr_tree_t *qrtree, int k, int *tiles, int *step, FILE *file);
......@@ -154,6 +162,8 @@ void draw_horizontal_line(int k, int p, int m, int step_p, int step_m, FILE *fil
void draw_vertical_line( int k, int p, int m, int step_m, FILE *file);
/**
* @}
*
* @name Low level trees
* @{
*/
......@@ -177,9 +187,16 @@ void hqr_high_greedy_init ( hqr_subpiv_t *arg, int minMN );
void hqr_high_greedy1p_init ( hqr_subpiv_t *arg );
/**
* @}
*
* @name Matrix reduction trees
* @{
*/
void libhqr_fct_to_mtx( const libhqr_tree_t *in, libhqr_tree_t *out );
void libhqr_rdmtx_initfct( libhqr_tree_t *out );
/**
* @}
*/
#endif /* _libhqr_internal_h_ */
......@@ -2,15 +2,14 @@
*
* @file libhqr_list.h
*
* List module for the treewalk algorithm.
* List module for the adapted reduction tree algorithm.
*
* @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2017-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
* @author Raphael Boucherie
* @author Mathieu Faverge
* @date 2017-03-21
* @date 2018-09-30
*
*/
#ifndef _libhqr_list_h_
......@@ -20,12 +19,22 @@ struct libhqr_list_elt_s;
typedef struct libhqr_list_elt_s libhqr_list_elt_t;
typedef struct libhqr_list_elt_s *libhqr_list_t;
/**
* @brief A list element data structure
*/
struct libhqr_list_elt_s {
libhqr_list_elt_t *next;
int id;
int date;
libhqr_list_elt_t *next; /**< The pointer to the next element in the list */
int id; /**< The id of the element */
int date; /**< The date of last modification of the element */
};
/**
* @brief Push an element into a sorted list
* @param[in,out] list_head
* The head of the list.
* @param[in,out] elt
* The element to add to the list at the right place.
*/
static inline void
libhqr_list_push( libhqr_list_t *list_head, libhqr_list_elt_t *elt )
{
......@@ -52,6 +61,12 @@ libhqr_list_push( libhqr_list_t *list_head, libhqr_list_elt_t *elt )
elt->next = next;
}
/**
* @brief Pop the first element of a sorted list
* @param[in,out] list_head
* The head of the list. On exit, the head is removed.
* @return The first element of the list.
*/
static inline libhqr_list_elt_t *
libhqr_list_pop( libhqr_list_t *list_head )
{
......
......@@ -4,7 +4,7 @@
*
* Queue module for the treewalk algorithm.
*
* @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2017-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
......
This diff is collapsed.
......@@ -6,7 +6,7 @@
* of Tennessee Research Foundation. All rights
* reserved.
*
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
......
......@@ -4,7 +4,7 @@
*
* File for algorithm of treewalking.
*
* @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2017-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
......@@ -29,8 +29,10 @@
char *colortree[] = {"red", "blue", "green", "orange", "cyan", "purple", "yellow" };
#define NBCOLORS (sizeof( colortree ) / sizeof( char* ))
/*
* functions writing in the svg file
/**
* @brief Write the svg header
* @param[in,out] file
* The opened file decriptor on which the data is written
*/
static void
drawsvg_header( FILE *file )
......@@ -48,6 +50,21 @@ drawsvg_header( FILE *file )
return;
}
/**
* @brief Write the box for the top node of a TS elimination
* @param[in,out] file
* The opened file decriptor on which the data is written
* @param[in] k
* The factorization step that defines the color.
* @param[in] x
* The abscissa coordinate of the node
* @param[in] y
* The ordinate coordinate of the node
* @param[in] w
* The width of the node
* @param[in] h
* The height of the node
*/
static void
drawsvg_top_TS( FILE *file, int k, int x, int y, int w, int h )
{
......@@ -60,6 +77,21 @@ drawsvg_top_TS( FILE *file, int k, int x, int y, int w, int h )
return;
}
/**
* @brief Write the box for the bottom node of a TS elimination
* @param[in,out] file
* The opened file decriptor on which the data is written
* @param[in] k
* The factorization step that defines the color.
* @param[in] x
* The abscissa coordinate of the node
* @param[in] y
* The ordinate coordinate of the node
* @param[in] w
* The width of the node
* @param[in] h
* The height of the node
*/
static void
drawsvg_bot_TS( FILE *file, int k, int x, int y, int w, int h )
{
......@@ -83,6 +115,21 @@ drawsvg_bot_TS( FILE *file, int k, int x, int y, int w, int h )
return;
}
/**
* @brief Write the circle for the top node of a TT elimination
* @param[in,out] file
* The opened file decriptor on which the data is written
* @param[in] k
* The factorization step that defines the color.
* @param[in] x
* The abscissa coordinate of the node
* @param[in] y
* The ordinate coordinate of the node
* @param[in] w
* The width of the node
* @param[in] h
* The height of the node
*/
static void
drawsvg_top_TT( FILE *file, int k, int x, int y, int w, int h )
{
......@@ -95,6 +142,21 @@ drawsvg_top_TT( FILE *file, int k, int x, int y, int w, int h )
return;
}
/**
* @brief Write the circle for the bottom node of a TT elimination
* @param[in,out] file
* The opened file decriptor on which the data is written
* @param[in] k
* The factorization step that defines the color.
* @param[in] x
* The abscissa coordinate of the node
* @param[in] y
* The ordinate coordinate of the node
* @param[in] w
* The width of the node
* @param[in] h
* The height of the node
*/
static void
drawsvg_bot_TT( FILE *file, int k, int x, int y, int w, int h )
{
......@@ -114,6 +176,21 @@ drawsvg_bot_TT( FILE *file, int k, int x, int y, int w, int h )
return;
}
/**
* @brief Write an svg line from (x1,y1) to (x2,y2)
* @param[in,out] file
* The opened file decriptor on which the data is written
* @param[in] k
* The factorization step that defines the color.
* @param[in] x1
* The abscissa coordinate of the origin node
* @param[in] y1
* The ordinate coordinate of the origin node
* @param[in] x2
* The abscissa coordinate of the destination node
* @param[in] y2
* The ordinate coordinate of the destination node
*/
static void
drawsvg_line( FILE *file, int k, int x1, int y1, int x2, int y2 )
{
......@@ -126,6 +203,11 @@ drawsvg_line( FILE *file, int k, int x1, int y1, int x2, int y2 )
return;
}
/**
* @brief Write the svg footer
* @param[in,out] file
* The opened file decriptor on which the data is written
*/
static void
drawsvg_footer( FILE *file )
{
......@@ -137,7 +219,23 @@ drawsvg_footer( FILE *file )
return;
}
/**
* @brief Draw the line corresponding to one TT/TS kernel
* @param[in,out] file
* The opened file decriptor on which the data is written
* @param[in] k
* The factorization step that defines the color.
* @param[in] p
* The index of the pivot
* @param[in] m
* The index of the tile being killed
* @param[in] beg_p
* The last modification date of p
* @param[in] beg_m
* The last modification date of m
* @param[in] end
* The computed end of the operation
*/
static void
drawsvg_lines_rowm( FILE *file, int k,
int p, int m, int beg_p, int beg_m, int end )
......@@ -164,13 +262,34 @@ drawsvg_lines_rowm( FILE *file, int k,
drawsvg_line( file, k, x, ym, x, yp );
}
/**
* @brief Draw all the lines related to a single step of the factorization
* @param[in] qrtree
* The reduction tree structure
* @param[in,out] file
* The opened file decriptor on which the data is written
* @param[in] full
* Defines if all the rows are involved in the process (tpqrt
* kernels), or only the lower triangular (geqrt kernels)
* @param[in] k
* The factorization step that defines the color.
* @param[in,out] tiles
* A temporary buffer of size qrtree->mt to store the list of tiles
* sorted by order of reduction
* @param[in,out] step
* A buffer of size qrtree->mt with the date of last modification
* for each tile. On exit, the dates are updated with the performed
* updates.
*/
static void
drawsvg_lines_stepk( const libhqr_tree_t *qrtree, FILE *file,
int full, int k, int *tiles, int *step )
{
int i, m, p, end;
int imax = qrtree->mt - 1;
if (!full) imax -= k;
if (!full) {
imax -= k;
}
/* Get order for step k */
libhqr_walk_stepk( qrtree, k, tiles );
......@@ -190,9 +309,24 @@ drawsvg_lines_stepk( const libhqr_tree_t *qrtree, FILE *file,
}
}
/**
* @brief Draw the two nodes related to one single reduction
* @param[in,out] file
* The opened file decriptor on which the data is written
* @param[in] k
* The factorization step that defines the color.
* @param[in] type
* The type of reduction performed in the libhqr_type_e
* @param[in] p
* The index of the pivot
* @param[in] m
* The index of the tile being killed
* @param[in] step_m
* The date at which the reduction occurs
*/
static void
drawsvg_nodes_rowm( FILE *file, int k,
int type, int p, int m, int step_m )
libhqr_type_e type, int p, int m, int step_m )
{
int x, yp, ym;
x = ((SIZE * 3) / 4) + SIZE * step_m;
......@@ -209,6 +343,13 @@ drawsvg_nodes_rowm( FILE *file, int k,
}
}
/**
* @brief Draw a given reduction tree in an output svg file
* @param[in] qrtree
* The reduction tree to draw
* @param[in] filename
* The output filename of the svg
*/
void
libhqr_print_svg( const libhqr_tree_t *qrtree,
const char *filename )
......
......@@ -5,7 +5,7 @@
* @copyright 2010-2017 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
......@@ -100,6 +100,13 @@ hqr_high_binary_prevpiv(const hqr_subpiv_t *arg, int k, int p, int start)
}
}
/**
* @brief Initialize the function pointers for a high-level binary tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a binary high level tree for QR/LQ factorization.
*/
void
hqr_high_binary_init(hqr_subpiv_t *arg) {
arg->currpiv = hqr_high_binary_currpiv;
......
......@@ -5,7 +5,7 @@
* @copyright 2010-2017 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
......@@ -59,6 +59,13 @@ hqr_high_fibonacci_nextpiv( const hqr_subpiv_t *qrpiv, int k, int p, int start )
return qrpiv->ldd;
}
/**
* @brief Initialize the function pointers for a high-level fibonacci tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a fibonacci high level tree for QR/LQ factorization.
*/
void
hqr_high_fibonacci_init(hqr_subpiv_t *arg) {
int *ipiv;
......@@ -91,9 +98,15 @@ hqr_high_fibonacci_init(hqr_subpiv_t *arg) {
}
}
/****************************************************
* HQR_HIGH_GREEDY_TREE (1 panel duplicated)
***************************************************/
/**
* @brief Initialize the function pointers for a replicated high-level greedy tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a replicated greedy high level tree for QR/LQ factorization.
* The greedy distribution is perfoned once, and then replicated on
* all other columns.
*/
void hqr_high_greedy1p_init(hqr_subpiv_t *arg){
int *ipiv;
int mt, p;
......
......@@ -5,7 +5,7 @@
* @copyright 2010-2017 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
......@@ -55,6 +55,13 @@ hqr_high_flat_prevpiv(const hqr_subpiv_t *arg, int k, int p, int start)
return arg->ldd;
}
/**
* @brief Initialize the function pointers for a high-level flat tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a flat high level tree for QR/LQ factorization.
*/
void
hqr_high_flat_init(hqr_subpiv_t *arg) {
arg->currpiv = hqr_high_flat_currpiv;
......
......@@ -5,7 +5,7 @@
* @copyright 2010-2017 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
......@@ -52,6 +52,15 @@ hqr_high_greedy_prevpiv(const hqr_subpiv_t *arg, int k, int p, int start)
return arg->ldd;
}
/**
* @brief Initialize the function pointers for a high-level greedy tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a greedy high level tree for QR/LQ factorization.
* The greedy algorithm is applied on all columns taking into
* account the history of previous steps.
*/
void
hqr_high_greedy_init(hqr_subpiv_t *arg, int minMN) {
int *ipiv;
......
......@@ -5,7 +5,7 @@
* @copyright 2010-2017 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
......@@ -89,10 +89,6 @@ static int hqr_getm( const libhqr_tree_t *qrtree, int k, int i );
static int hqr_geti( const libhqr_tree_t *qrtree, int k, int m );
static int hqr_gettype( const libhqr_tree_t *qrtree, int k, int m );
/* Permutation */
static void hqr_genperm ( libhqr_tree_t *qrtree );
static int hqr_getinvperm( const libhqr_tree_t *qrtree, int k, int m );
/****************************************************
* Common ipiv
***************************************************
......@@ -206,14 +202,17 @@ hqr_geti( const libhqr_tree_t *qrtree, int k, int m )
int end2 = p + ( domino ? k*p : k + nbextra1 );
/* Tile of type 2 or 3 or the 1 between the diagonal and the multiple after the diagonal */
if ( lm < end2 )
if ( lm < end2 ) {
return lm-k;
}
/* Tile of type 1 */
else {