Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Covariance and contravariance


In the News (Fri 1 Jun 12)

  
  Covariance and contravariance - Wikipedia, the free encyclopedia
In mathematics and theoretical physics, covariance and contravariance are concepts used in many areas, generalizing in a sense invariance, i.e., the property of being unchanged under some transformation.
Contravariant is a mathematical term with a precise definition in tensor analysis.
By considering a coordinate transformation on a manifold as a map from the manifold to itself, the transformation of covariant indices of a tensor are given by a pullback, and the transformation properties of the contravariant indices is given by a pushforward.
en.wikipedia.org /wiki/Covariance_and_contravariance   (1781 words)

  
 Covariance and contravariance (computer science) - Wikipedia, the free encyclopedia
Covariance means that the type of arguments, return values, or exceptions of overriding methods can be subtypes of the original types.
Contravariance means that the type of arguments, return values, or exceptions of overriding methods can be supertypes of the original types.
In the C# programming language, support for both return-type covariance and parameter contravariance for delegates was added in version 2.0 of the language.
en.wikipedia.org /wiki/Parameter_covariance   (703 words)

  
 Covariance - Wikipedia, the free encyclopedia
Intuitively, covariance is the measure of how much two variables vary together (as distinct from variance, which measures how much a single variable varies).
By contrast, correlation, which depends on the covariance, is a dimensionless measure of linear dependence.
The covariance is sometimes called a measure of "linear dependence" between the two random variables.
en.wikipedia.org /wiki/Covariance   (388 words)

  
 Invariance, Contravariance, Covariance
You can also have "mixed" tensors, which are covariant with respect to some of their indicies and contravariant with respect to others.
At this point people often wonder how we can talk about a vector being contravariant or covariant when the direction and magnitude of a vector (which are its defining properties) are actually invariant with respect to coordinate changes.
Of course, in the case of orthogonal cartesian coordinates the axes are, by definition, normal to constant coordinate surfaces, so the distinction between contravariant and covariant components vanishes.
www.mathpages.com /home/kmath398.htm   (972 words)

  
 [No title]
Covariant return types on method overrides make this explicit, allowing the use of a type that is derived from the return type of the method being overridden as the return type of the method doing the overriding.
Contravariance is, in a sense, the opposite of covariance.
With delegate parameter type contravariance, the code in Figure 3 is all that is necessary (most of which is just verifying that the event's handler type does in fact have a compatible signature).
msdn.microsoft.com /msdnmag/issues/05/10/NETMatters/default.aspx   (2409 words)

  
 Untitled
In a limited context, the terms "Covariance" and "Contravariance" arise in cases where you have a basis for a vector space that is NOT orthonormal.
In the restricted context of the presence of a metric, one way to view covariance and contravariance is to think of them as different basis descriptions of the same object.
In the physical sciences "Contravariant" applies to vectors that arise from the derivative of the position vector, such as velocity and acceleration.
home.pacbell.net /bbowen/covariant.htm   (610 words)

  
 Covariance and Contravariance in Delegates (C#)
Covariance and contravariance provide a degree of flexibility when matching method signatures with delegate types.
Covariance permits a method to have a more derived return type than what is defined in the delegate.
Contravariance permits a method with parameter types that are less derived than in the delegate type.
msdn2.microsoft.com /en-us/library/ms173174.aspx   (314 words)

  
 Paper announcement on OO type systems   (Site not responding. Last check: 2007-10-23)
Why covariance and contravariance are not opposing views but both *must* be integrated in a *type-safe* formalism.
A covariant relation, instead, characterizes the {\em specialization\/} of code (i.e.\ the definition of new code that replaces the old one {\em in some particular cases\/}).
Therefore, covariance and contravariance are not opposing views, but distinct concepts that each have their place in object-oriented systems and that both can (and should) be type safely integrated in an object-oriented language.
www.cis.upenn.edu /~bcpierce/types/archives/1994/msg00138.html   (358 words)

  
 VBGood论坛交流 - 相关消息 - MSDN:.NET Matters: NamedGZipStream, Covariance and Contravariance - VBGood.com
A The terms "covariance" and "contravariance" are object-oriented lingo used to describe how types relate.
Unfortunately, covariant return types are not supported in the common language runtime (CLR) and they're not supported in C# or Visual Basicandreg;, at least not yet (Suggestion Details: Need covariant return types in C# / all.Net langage).
With delegate parameter type contravariance, the code in Figure 3 is all that is necessary (most of which is just verifying that the event's handler type does in fact have a compatible signature).
www.vbgood.com /viewthread.php?tid=22841   (2332 words)

  
 Contra Vs Co Variance
Covariance seems to jibe with our notion that subclasses are more specialized, less general than their superclasses.
Therefore, covariance and contravariance are not opposing views, but distinct concepts that each have their place in object-oriented systems.
We also show that the independence of the two mechanisms is not characteristic of a particular model but is valid in general, since covariant specialization is present in record-based models, although it is hidden by a deficiency of all existing calculi that realize this model.
c2.com /cgi/wiki?ContraVsCoVariance   (593 words)

  
 Smart Software: Covariance and Contravariance for Delegates
According to the Whidbey help, contravariance of delegate parameters and covariance of return types may be supported for delegates in the Whidbey release.
Covariance of return values allows a delegate of type, say D, to wrap a method whose return value is of a type, which derives from or equals the return value type of D. For example, MyDelegate may match the following as a result of covariance:
Contravariance of methods parameters allows a delegate of type D to wrap a method whose parameters have a type, which is either a base class of or the same class of the type of the corresponding parameter in the signature of D. For example, MyDelegate may match the following as a result of contravariance:
wesnerm.blogs.com /net_undocumented/2004/06/covariance_and_.html   (472 words)

  
 [No title]
Subtyping — contravariant inheritance redefinition In this new context, the words type and subtype are used in the theoretical, mathematical sense as "a set of values and the associated operations", not in the programming sense as something, from which to declare a variable.
Contravariance rule for parameter type redeclaration Suggested parameter redeclaration in Circle: Ellipse cloneCentered(Parallelepiped p) OK, since r from the argument “is a” Parallelepiped.
For a function redefined in a subclass to be type compatible the variations in the parameters should be contravariant (original inherit from redefined) the variations in the return type should be covariant (redefined inherits from original) The term contravariant variation covers a mixture of contravariance and covariance.
www.cs.kau.se /~eivind/oom/presentations/Variations_on_inheritance.doc   (1809 words)

  
 Back to Generics: Contravariance and Erasure
Contravariance, as a result, leads to simpler mathematical models of the inheritance-redefinition-polymorphism mechanism.
But the argument is not very convincing, since, as we have seen and as the literature readily admits, contravariance is of essentially no practical use.
So rather than trying to force a covariant body into a contravariant suit, we should accept the reality for what it is, covariant, and study ways to remove the unpleasant effects.
www.artima.com /weblogs/viewpost.jsp?thread=132041   (713 words)

  
 Francesco's blog - Delegate covariance and controvariance in Visual Basic !   (Site not responding. Last check: 2007-10-23)
Delegate contravariance lets you create a delegate that points to a method whose argument is the base type of the argument that appears in the delegate's signature.
In previous example, contravariance enables you to create a GetControlData delegate that points to a method that accepts a Control or Object value, because these types are both base types for the TextBox class specified in the delegate signature.
It should be evident that covariance and contravariance don't impact code robustness and can't cause type mismatch errors at runtime.
www.dotnet2themax.com /blogs/fbalena/PermaLink,guid,3741061e-5656-4f12-abe9-1ada257deaa2.aspx   (713 words)

  
 Description of the new covariance and contravariance features and how the lookup behavior for delegates has changed in ...
Covariance and contravariance are new features in Microsoft Visual C# 2005.
The following code samples demonstrate the change in delegate behavior from both the covariance and contravariance perspectives.
This behavior occurs because of the reasons that are mentioned in the "Covariance" section.
support.microsoft.com /kb/913454/en-us   (544 words)

  
 Computing Reviews, the leading online review service for computing literature.   (Site not responding. Last check: 2007-10-23)
data model [1] and later the Eiffel language [2] introduced the concept of covariant specialization of methods, type theorists have argued whether it is better to use covariant or contravariant specialization for the methods in object-oriented languages.
He goes on to show that both covariance and contravariance can be used in a way that guarantees type safety.
Covariance captures code specialization where the definition of new code replaces old definitions in some particular cases.
www.reviews.com /review/review_review.cfm?review_id=119384   (324 words)

  
 Informat.io on Covariance And Contravariance
Covariant parameters are not safe, but covariant return types and exceptions are.
Similarly, contravariant parameters are safe, but contravariant return types and exceptions are not.
covariance and contravariance in mathematics and theoretical physics.
www.informat.io /?title=covariance-and-contravariance   (345 words)

  
 Archives of the Caml mailing list > Message from Markus Mottl
There is nice paper of Guiseppe Castagna > "Covariance and Contravariance: Conflict without a Cause" [1] > which discusses those features and their relation.
[snip] The contravariant rule, besides being less intuitive than the covariant one, is the source of many problems.
Thus, it is certainly not advisable to use it as a surrogate for the missing feature of covariance.
caml.inria.fr /pub/ml-archives/caml-list/1999/01/d3f31dac2decdbd164c27098366e9309.en.html   (598 words)

  
 Covariant Deep Subtyping Reconsidered   (Site not responding. Last check: 2007-10-23)
Covariant Deep Subtyping Reconsidered David L. Shang ABSTRACT Covariant deep subtyping has been viewed as a way to narrow the range of a component in subtypes.
In this paper, however, we see covariant deep subtyping in a new light -- a way to clarify a vague but fixed range of a component in subclasses.
Traditional Covariance Is Neither Sound Nor Required -- When subclasses require restrictive covariance, there is usually an untrue promise in their superclass.
www.cis.upenn.edu /~bcpierce/types/archives/1996/msg00048.html   (164 words)

  
 Wikinfo | Functor
Algebra of continuous functions: a contravariant functor from the category of topological spaces (with continuous maps as morphisms) to the category of real associative algebras is given by assigning to every topological space X the algebra C(X) of all real-valued continuous functions on that space.
Tangent and cotangent bundles: The map which sends every differentiable manifold to its tangent bundle and every smooth map to its derivative is a covariant functor from the category of differentiable manifolds to the category of vector bundles.
This is a functor which is contravariant in the first and covariant in the second argument, i.e.
www.wikinfo.org /wiki.php?title=Functor   (1552 words)

  
 Abstract Classes and Subtyping: Inheritance Part B
The contravariant rule is quite simple, and a bit counter-intuitive at first.
You will frequently hear claims by the Eiffel people that their system uses the more natural covariance rule and is still statically typesafe due to a "closed-system" checking algorithm, which is not yet implemented in the Eiffel compilers (someone correct me if I'm wrong).
With contravariance, on the other hand, any legal function call (based just on the signatures, and not on some arbitrary property of the computation involved) will be accepted by the compiler and will be typesafe.
www.icsi.berkeley.edu /~sather/Documentation/EclecticTutorial/node5.html   (1564 words)

  
 Physics Help and Math Help - Physics Forums - View Single Post - Math "Newb" Wants to know what a Tensor is
Here you have to explain what do you mean saying 'intrinsic properties', because what is 'covariance or contravariance' and what is the 'object' are well known.
In those cases, the contravariant and covariant vectors are different.
The physical interpretation has only the product of contravariant and covariant vectors (braket) which is invariant.
www.physicsforums.com /showpost.php?p=412972&postcount=88   (1236 words)

  
 Generics are a mistake? | Lambda the Ultimate
I suppose my criticism boils down to the article conflating two totally different complexities: the one-shot complexity of learning enough about covariance and contravariance for the array issue to be comprehensible, and the existential complexity of the array issue arising from Java's historic use of covariant arrays being coupled with the introduction of generics.
the cost of revisiting covariant arrays on the table, it strikes me as at least intellectually dishonest not even to observe that the presence or absence of that cost has a direct effect on the complexity cost of generics.
To reiterate, if we want to say that covariant arrays in Java are inviolate, that's fine, I guess, but let's at least acknowledge that we're doing that and that it imposes a complexity cost on generics that doesn't have to be there.
lambda-the-ultimate.org /node/804   (8429 words)

  
 IKVM.NET Weblog - Whidbey, Generics, Co- and contravariance
As far as I can tell this hasn't been documented anywhere yet, but the Whidbey beta 1 CLR supports covariant and contravariant generic type parameters.
Notice the plus and minus signs in the interface declarations to signal that a generic type parameter is covariant or contravariant.
I don't think it would be a good idea to infer it automatically (that would create a huge versioning problem, if later on you decided to add a new method that would suddenly change the variance of a type).
weblog.ikvm.net /CommentView.aspx?guid=21f9ed86-827e-4666-9553-5d4a8d735b7e   (764 words)

  
 Intelligent Enterprise Magazine - C.J. Date   (Site not responding. Last check: 2007-10-23)
Note carefully that, unlike "result covariance," "argument contravariance" must be made explicit (by defining explicit specializations of the operator in question), because it refers to the declared types of parameters to such specializations.
As I said last month, result covariance is presumably so called on the grounds that the most specific type of the result "covaries" with the most specific type of the argument.
In any case, the type of the result can "covary" even if the argument type remains fixed (remember the EORC example from the last installment), or even if there are no explicit arguments at all (imagine an operator that returns a circle on weekdays but just an ellipse at weekends).
www.intelligententerprise.com /000818/date.jhtml   (1727 words)

  
 search.com - General covariance - Search.com Reference
In theoretical physics, general covariance (also known as diffeomorphism covariance) is the invariance of the form of physical laws under arbitrary coordinate transformations.
The principle of general covariance was formulated by Einstein who wanted to extend the Lorentz covariance in Special Relativity to non-inertial frames.
The general principle of relativity as used in Einstein's general theory of relativity is that the laws of physics must take the same form in all reference frames.
domainhelp.search.com /reference/General_covariance   (318 words)

  
 Kirk Allen Evans' Blog : Contravariance and Covariance
In a recent talk on What's New in C# 2.0, I explained the concepts of covariance and contravariance.
Stephen Toub has a great article in the October 2005 issue of MSDN Magazine that explains covariance and contravariance.
The reason that most developers choose arrays is because it is just too much work to define a strongly-typed collection with iterators, arrays just makes that easier.
blogs.msdn.com /kaevans/archive/2006/02/20/535406.aspx   (209 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.