A vector of ones or all-ones vector is matrix of ones having row or column form.
For an n × n matrix of ones J, the following properties hold:
- The trace of J equals n, and the determinant equals 0 for n ≥ 2, but equals 1 if n = 1 (or if n = 0 if we want to consider the empty square matrix, which is an all-ones matrix).
- The characteristic polynomial of J is .
- The rank of J is 1 and the eigenvalues are n with multiplicity 1 and 0 with multiplicity n − 1.
- for 
- J is the neutral element of the Hadamard product.
When J is considered as a matrix over the real numbers, the following additional properties hold:
The all-ones matrix arises in the mathematical field of combinatorics, particularly involving the application of algebraic methods to graph theory. For example, if A is the adjacency matrix of an n-vertex undirected graph G, and J is the all-ones matrix of the same dimension, then G is a regular graph if and only if AJ = JA. As a second example, the matrix appears in some linear-algebraic proofs of Cayley's formula, which gives the number of spanning trees of a complete graph, using the matrix tree theorem.
- Horn, Roger A.; Johnson, Charles R. (2012), "0.2.8 The all-ones matrix and vector", Matrix Analysis, Cambridge University Press, p. 8, ISBN 9780521839402.
- Weisstein, Eric W. "Unit Matrix". MathWorld.
- Stanley, Richard P. (2013), Algebraic Combinatorics: Walks, Trees, Tableaux, and More, Springer, Lemma 1.4, p. 4, ISBN 9781461469988.
- Stanley (2013); Horn & Johnson (2012), p. 65.
- Timm, Neil H. (2002), Applied Multivariate Analysis, Springer texts in statistics, Springer, p. 30, ISBN 9780387227719.
- Smith, Jonathan D. H. (2011), Introduction to Abstract Algebra, CRC Press, p. 77, ISBN 9781420063721.
- Godsil, Chris (1993), Algebraic Combinatorics, CRC Press, Lemma 4.1, p. 25, ISBN 9780412041310.