Creates a single-column matrix where the values of that column are as given in column
.
Matrix.column_vector([4,5,6]) => 4 5 6
Returns the number of rows.
Returns an array of the row vectors of the matrix. See Vector
.
Returns an array of the column vectors of the matrix. See Vector
.
Add option switch like with on
, but at head of summary.
Add option switch like with on
, but at tail of summary.
Convenience method for Shell::CommandProcessor.unalias_command
Removes tracing for the specified command on the given global variable and returns nil
. If no command is specified, removes all tracing for that variable and returns an array containing the commands actually removed.
Returns a pretty printed object as a string.
In order to use this method you must first require the PP
module:
require 'pp'
See the PP
module for more information.
Ruby tries to load the library named string relative to the requiring file’s path. If the file’s path cannot be determined a LoadError
is raised. If a file is loaded true
is returned and false otherwise.
Iterates the given block for each array of consecutive <n> elements. If no block is given, returns an enumerator.
e.g.:
(1..10).each_cons(3) { |a| p a } # outputs below [1, 2, 3] [2, 3, 4] [3, 4, 5] [4, 5, 6] [5, 6, 7] [6, 7, 8] [7, 8, 9] [8, 9, 10]
Counts symbols for each Symbol
type.
This method is only for MRI developers interested in performance and memory usage of Ruby programs.
If the optional argument, result_hash, is given, it is overwritten and returned. This is intended to avoid probe effect.
Note: The contents of the returned hash is implementation defined. It may be changed in future.
This method is only expected to work with C Ruby.
On this version of MRI, they have 3 types of Symbols (and 1 total counts).
* mortal_dynamic_symbol: GC target symbols (collected by GC) * immortal_dynamic_symbol: Immortal symbols promoted from dynamic symbols (do not collected by GC) * immortal_static_symbol: Immortal symbols (do not collected by GC) * immortal_symbol: total immortal symbols (immortal_dynamic_symbol+immortal_static_symbol)
Calls the block once for each living, nonimmediate object in this Ruby process. If module is specified, calls the block for only those classes or modules that match (or are a subclass of) module. Returns the number of objects found. Immediate objects (Fixnum
s, Symbol
s true
, false
, and nil
) are never returned. In the example below, each_object
returns both the numbers we defined and several constants defined in the Math
module.
If no block is given, an enumerator is returned instead.
a = 102.7 b = 95 # Won't be returned c = 12345678987654321 count = ObjectSpace.each_object(Numeric) {|x| p x } puts "Total count: #{count}"
produces:
12345678987654321 102.7 2.71828182845905 3.14159265358979 2.22044604925031e-16 1.7976931348623157e+308 2.2250738585072e-308 Total count: 7
Removes all finalizers for obj.
Dump Ruby object
to a JSON
string.