The R Project SVN R

Rev

Rev 72229 | Rev 82142 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 72229 Rev 76136
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 
3
 
-
 
4
 *  Copyright (C) 2007-2019  The R Core Team
4
 *  Copyright (C) 1994-9 W. N. Venables and B. D. Ripley
5
 *  Copyright (C) 1994-9 W. N. Venables and B. D. Ripley
5
 *  Copyright (C) 2007-2017  The R Core Team
-
 
6
 *
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  (at your option) any later version.
10
 *  (at your option) any later version.
Line 46... Line 46...
46
    Rboolean isna, used_random = FALSE, do_rand = *ties_meth == 1;
46
    Rboolean isna, used_random = FALSE, do_rand = *ties_meth == 1;
47
 
47
 
48
    for (size_t r = 0; r < n_r; r++) {
48
    for (size_t r = 0; r < n_r; r++) {
49
	/* first check row for any NAs and find the largest abs(entry) */
49
	/* first check row for any NAs and find the largest abs(entry) */
50
	large = 0.0;
50
	large = 0.0;
51
	isna = FALSE;
51
	isna = TRUE;
52
	for (c = 0; c < *nc; c++) {
52
	for (c = 0; c < *nc; c++) {
53
	    a = matrix[r + c * n_r];
53
	    a = matrix[r + c * n_r];
54
	    if (ISNAN(a)) { isna = TRUE; break; }
54
	    if (ISNAN(a)) { isna = TRUE; break; }
-
 
55
	    else if(isna) isna = FALSE;
55
	    if (!R_FINITE(a)) continue;
56
	    if (!R_FINITE(a)) continue;
56
	    if (do_rand) large = fmax2(large, fabs(a));
57
	    if (do_rand) large = fmax2(large, fabs(a));
57
	}
58
	}
58
	if (isna) { maxes[r] = NA_INTEGER; continue; }
59
	if (isna) { maxes[r] = NA_INTEGER; continue; }
59
 
60