Method List
-
#* SY::Dimension
-
#* SY::Mapping
-
#* SY::Magnitude
-
#* SY::Unit
-
#* SY::Composition
-
#* Matrix
-
#* SY::Quantity
-
#** SY::Mapping
-
#** SY::Quantity
-
#** SY::Unit
-
#** SY::Magnitude
-
#+ SY::SignedMagnitude
-
#+ SY::Unit
-
#+ SY::AbsoluteMagnitude
-
#+ SY::Magnitude
-
#+ SY::Dimension
-
#+ SY::Composition
-
#+@ SY::Magnitude
-
#+@ SY::Composition
-
#- SY::Unit
-
#- SY::AbsoluteMagnitude
-
#- SY::Magnitude
-
#- SY::Composition
-
#- SY::SignedMagnitude
-
#- SY::Dimension
-
#-@ SY::Composition
-
#-@ SY::Magnitude
-
#/ SY::Unit
-
#/ SY::Dimension
-
#/ SY::Magnitude
-
#/ SY::Quantity
-
#/ SY::Composition
-
#/ SY::Mapping
-
#<=> SY::Magnitude
-
#== SY::Dimension
-
Amount SY
-
Dimension SY
-
Magnitude SY
-
Quantity SY
-
Unit SY
-
#[] SY::Dimension
-
__new__ SY::Dimension
-
#abbreviation SY::Unit
-
abbreviations SY::Unit
-
#abs SY::Magnitude
-
absolute SY::Magnitude
-
#absolute SY::Quantity
-
#absolute SY::Magnitude
-
#absolute? SY::Quantity
-
#add SY::AbsoluteMagnitude
-
#amount SY::Magnitude
-
#atomic? SY::Composition
-
base SY::Dimension
-
#base? SY::Dimension
-
#call SY::Magnitude
-
#coerce SY::Unit
-
#coerce SY::Magnitude
-
#coerce SY::Quantity
-
#colleague SY::Quantity
-
#composition SY::Quantity
-
difference SY::Magnitude
-
#dimension SY::Quantity
-
#dimension SY::Composition
-
dimensionless SY::Quantity
-
#dimensionless? SY::Quantity
-
empty SY::Composition
-
#ex SY::Mapping
-
#expand SY::Composition
-
#export SY::Quantity
-
#export SY::Mapping
-
identity SY::Mapping
-
#im SY::Mapping
-
#import SY::Quantity
-
#import SY::Mapping
-
#in SY::Magnitude
-
included SY::Unit
-
#infer_mapping SY::Composition
-
#initialize SY::Quantity
-
#initialize SY::AbsoluteMagnitude
-
#initialize SY::Mapping
-
#initialize SY::SignedMagnitude
-
#initialize SY::Unit
-
#initialize SY::Dimension
-
#inspect SY::Magnitude
-
inspect SY.lambda { |ßs, exps| raise ArgumentError unless ßslambda { |ßs, exps| raise ArgumentError unless ßs.size == expslambda { |ßs, exps| raise ArgumentError unless ßs.size == exps.size exps = exps.map{|e| Integer e } zipped = ßs.zip( exps ) clean = zipped.reject {|e| e[1] == 0 } # omit exponents equal to 1: clean.map{|ß, exp| "#{ß}#{exp == 1 ? "" : SUPERSCRIPT[exp]}" }.join "." }
-
inspect SY.lambda { |input_ς, ßs, prefixes = []| input_ς = input_ςlambda { |input_ς, ßs, prefixes = []| input_ς = input_ς.to_slambda { |input_ς, ßs, prefixes = []| input_ς = input_ς.to_s.strip ßs = ßs.map &:to_s prefixes = ( prefixes.map( &:to_s ) << '' ).uniq # input string splitting input_ς_sections = input_ς.split '.' if input_ς_sections.empty? raise NameError, "Bad input string: '#{input_ς}'!" unless input_ς.empty? return [], [], [] end # analysis of input string sections input_ς_sections.each_with_object [[], [], []] do |_section_, memo| section = _section_.dup superscript_chars = SUPERSCRIPT.values # chop off the superscript tail, if any section.chop! while superscript_chars.any? { |ch| section.end_with? ch } # the set of candidate unit symbols candidate_ßs = ßs.select { |ß| section.end_with? ß } # seek candidate prefixes corresponding to candidate_ßs candidate_prefixes = candidate_ßs.map { |ß| section[ 0..((-1) - ß.size) ] } # see which possible prefixes can be confirmed confirmed_prefixes = candidate_prefixes.select { |x| prefixes.include? x } # complain if no symbol matches sec raise NameError, "Unknown unit: '#{section}'!" if confirmed_prefixes.empty? # pay attention to ambiguity in prefix/symbol pair if confirmed_prefixes.size > 1 then if confirmed_prefixes.any? { |x| x == '' } then # prefer empty prefixes chosen_prefix = '' else raise NameError, "Ambiguity in interpretation of '#{section}'!" end else chosen_prefix = confirmed_prefixes[0] end # Based on it, interpret the section parts: unit_ς = section[ (chosen_prefix.size)..(-1) ] suffix = _section_[ ((-1) - chosen_prefix.size - unit_ς.size)..(-1) ] # Make the exponent string suffix into the exponent number: exponent_ς = SUPERSCRIPT_DOWN[ suffix ] # Complain if bad: raise NameError, "Malformed exponent in #{_section_}!" if exponent_ς.nil? exponent_ς = "1" if exponent_ς == '' # empty exponent string means 1 exp = Integer exponent_ς raise NameError, "Zero exponents not allowed: #{exponent_ς}" if exp == 0 # and store the interpretation memo[0] << chosen_prefix; memo[1] << unit_ς; memo[2] << exp memo end }
-
#inspect SY::Dimension
-
#inspect SY::Unit
-
#inspect SY::Quantity
-
instances SY::Dimension
-
#inverse SY::Mapping
-
#irreducible? SY::Quantity
-
#irreducible? SY::Composition
-
known_symbols SY::Unit
-
#magnitude SY::Quantity
-
#mapping SY::Quantity
-
#mapping_to SY::Quantity
-
#method_missing SY::ExpressibleInUnits
-
#name SY::Unit
-
#negative? SY::Magnitude
-
new SY::Dimension
-
#new_quantity SY::Composition
-
#new_standard_unit SY::Quantity
-
#nonnegative? SY::Magnitude
-
of SY::Quantity
-
of SY::Unit
-
of SY::Magnitude
-
parse_sps_using_all_prefixes SY::Unit
-
pre_included SY::Unit
-
#protect! SY::Quantity
-
#protected? SY::Quantity
-
#quantity SY::Magnitude
-
#quantity_by_prefix SY::Unit
-
#ratio SY::Mapping
-
#reframe SY::Magnitude
-
#reframe SY::Unit
-
#relative SY::Magnitude
-
#relative SY::Quantity
-
#relative? SY::Quantity
-
#respond_to_missing? SY::ExpressibleInUnits
-
#round SY::Magnitude
-
#set_colleague SY::Quantity
-
#set_composition SY::Quantity
-
#set_mapping SY::Quantity
-
#short= SY::Unit
-
#simple? SY::Composition
-
#simple? SY::Quantity
-
#simplify SY::Composition
-
singular SY::Composition
-
#singular? SY::Composition
-
#standard SY::Quantity
-
standard SY::Quantity
-
standard SY::Unit
-
#standard! SY::Quantity
-
#standard? SY::Quantity
-
standard_quantities SY::Dimension
-
#standard_quantity SY::Dimension
-
#standard_unit SY::Quantity
-
#standardish? SY::Quantity
-
#subtract SY::AbsoluteMagnitude
-
#take SY::AbsoluteMagnitude
-
#to_a SY::Dimension
-
#to_composition SY::Dimension
-
#to_hash SY::Dimension
-
#to_magnitude SY::Magnitude
-
#to_quantity SY::Composition
-
#to_s SY::Dimension
-
#to_s SY::Quantity
-
#to_s SY::Unit
-
#to_s SY::Magnitude
-
#unit SY::Quantity
-
#units SY::Quantity
-
#unprotect! SY::Quantity
-
wildcard_zero Matrix
-
zero SY::Magnitude
-
zero SY::Dimension
-
#zero? SY::Dimension