Sponsored Content
Full Discussion: Randomize a matrix
Top Forums Shell Programming and Scripting Randomize a matrix Post 302741597 by bakunin on Sunday 9th of December 2012 09:42:32 AM
Old 12-09-2012
This is probably not as easy as it sounds. You only have 0 and 1 as elements and a fixed number of 1s in every row and column as a further limiting factors. The number of possible permutations is well below 1000 - for a single 4-element field for example it is:

4 with 1 1-field
6 with 2 1-fields
4 with 3 1-fields
1 with 4 1-fields

This is probably solvable with the same sort of algorithm as the "8-queens-problem" (for which there are also only 96 distinct solutions and even of these 3/4 of them are axial- and/or mirror-symmetrical variants).

I hope this helps.

bakunin
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

diagonal matrix to square matrix

Hello, all! I am struggling with a short script to read a diagonal matrix for later retrieval. 1.000 0.234 0.435 0.123 0.012 0.102 0.325 0.412 0.087 0.098 1.000 0.111 0.412 0.115 0.058 0.091 0.190 0.045 0.058 1.000 0.205 0.542 0.335 0.054 0.117 0.203 0.125 1.000 0.587 0.159 0.357... (11 Replies)
Discussion started by: yifangt
11 Replies

2. Shell Programming and Scripting

Matrix

Hi All I would like to merge multiple files with the same row and column size into a matrix format In a folder I have multiple files in the following format vi 12.txt a 1 b 5 c 7 d 0 vi 45.txt a 3 b 6 c 9 d 2 vi 9.txt a 4 (7 Replies)
Discussion started by: Lucky Ali
7 Replies

3. Ubuntu

How to convert full data matrix to linearised left data matrix?

Hi all, Is there a way to convert full data matrix to linearised left data matrix? e.g full data matrix Bh1 Bh2 Bh3 Bh4 Bh5 Bh6 Bh7 Bh1 0 0.241058 0.236129 0.244397 0.237479 0.240767 0.245245 Bh2 0.241058 0 0.240594 0.241931 0.241975 ... (8 Replies)
Discussion started by: evoll
8 Replies

4. Programming

Matrix code in C++

I have the code below in C++ and am trying to understand what these do and how to call them. template <class Type> class Matrix { public: Matrix(); Matrix( const int m, const int n ); Matrix( const Matrix& A ); ~Matrix(); (0 Replies)
Discussion started by: kristinu
0 Replies

5. Shell Programming and Scripting

awk? adjacency matrix to adjacency list / correlation matrix to list

Hi everyone I am very new at awk but think that that might be the best strategy for this. I have a matrix very similar to a correlation matrix and in practical terms I need to convert it into a list containing the values from the matrix (one value per line) with the first field of the line (row... (5 Replies)
Discussion started by: stonemonkey
5 Replies

6. Shell Programming and Scripting

Randomize letters

Hi, Is there a tool somewhat parallel to rev, but which randomizes instead of reverses? I've tried rl, but I can only get it to randomize words. I was hoping for something like this echo "hello" | ran leolh less simpler solutions are also welcome. Sorry if the question is... (21 Replies)
Discussion started by: jeppe83
21 Replies

7. Shell Programming and Scripting

Randomize a file

Hi, I have a large file that looks like this: @FCC189PACXX:2:1101:1420:2139/1 AGCGAGACTCCGTCTCAAAAAGAAAAAATTTTTCAAAATATTGCAATGGGCTTGTAATTTCTGCTTAAATGTCAGGAGGTCTGAGCCATT + bbbeeeceggggghiiiiiiiiiihfihihiiihhhghiihhihifhihiihhhhhhhhiiigfggggdceeeeebdcc^``bbcbccbb... (3 Replies)
Discussion started by: kylle345
3 Replies

8. Shell Programming and Scripting

Randomize columns in CSV file

Hi there, friends! Writing exams again! This time my wish would be to randomize certain columns in a csv file. Given a file containing records consisting of 3 columns tab-separated: A B C A B C A B C I would love to get the columns of each record in random order...separated by a tab as... (12 Replies)
Discussion started by: eldeingles
12 Replies
zlaesy.f(3)							      LAPACK							       zlaesy.f(3)

NAME
zlaesy.f - SYNOPSIS
Functions/Subroutines subroutine zlaesy (A, B, C, RT1, RT2, EVSCAL, CS1, SN1) ZLAESY computes the eigenvalues and eigenvectors of a 2-by-2 complex symmetric matrix. Function/Subroutine Documentation subroutine zlaesy (complex*16A, complex*16B, complex*16C, complex*16RT1, complex*16RT2, complex*16EVSCAL, complex*16CS1, complex*16SN1) ZLAESY computes the eigenvalues and eigenvectors of a 2-by-2 complex symmetric matrix. Purpose: ZLAESY computes the eigendecomposition of a 2-by-2 symmetric matrix ( ( A, B );( B, C ) ) provided the norm of the matrix of eigenvectors is larger than some threshold value. RT1 is the eigenvalue of larger absolute value, and RT2 of smaller absolute value. If the eigenvectors are computed, then on return ( CS1, SN1 ) is the unit eigenvector for RT1, hence [ CS1 SN1 ] . [ A B ] . [ CS1 -SN1 ] = [ RT1 0 ] [ -SN1 CS1 ] [ B C ] [ SN1 CS1 ] [ 0 RT2 ] Parameters: A A is COMPLEX*16 The ( 1, 1 ) element of input matrix. B B is COMPLEX*16 The ( 1, 2 ) element of input matrix. The ( 2, 1 ) element is also given by B, since the 2-by-2 matrix is symmetric. C C is COMPLEX*16 The ( 2, 2 ) element of input matrix. RT1 RT1 is COMPLEX*16 The eigenvalue of larger modulus. RT2 RT2 is COMPLEX*16 The eigenvalue of smaller modulus. EVSCAL EVSCAL is COMPLEX*16 The complex value by which the eigenvector matrix was scaled to make it orthonormal. If EVSCAL is zero, the eigenvectors were not computed. This means one of two things: the 2-by-2 matrix could not be diagonalized, or the norm of the matrix of eigenvectors before scaling was larger than the threshold value THRESH (set below). CS1 CS1 is COMPLEX*16 SN1 SN1 is COMPLEX*16 If EVSCAL .NE. 0, ( CS1, SN1 ) is the unit right eigenvector for RT1. Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: September 2012 Definition at line 116 of file zlaesy.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.2 Tue Sep 25 2012 zlaesy.f(3)
All times are GMT -4. The time now is 10:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy